Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2013-12-02 18:04:06

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

ffmpeg is a beauty :-)

Hi,

Look what ffmpeg can do now:

root@cpanel [/home/re/public_html/modules/video/scripts]# ffprobe -loglevel quiet -show_format -show_streams -print_format json /home/re/public_html/media/videos/mp4/130.mp4 
{
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1001/60000",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 720,
            "height": 404,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "180:101",
            "pix_fmt": "yuv420p",
            "level": 30,
            "r_frame_rate": "30000/1001",
            "avg_frame_rate": "30000/1001",
            "time_base": "1/30000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 193843650,
            "duration": "6461.455000",
            "bit_rate": "1399532",
            "nb_frames": "193650",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0
            },
            "tags": {
                "creation_time": "2012-02-09 07:58:16",
                "language": "eng",
                "handler_name": "Video Media Handler"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 310152192,
            "duration": "6461.504000",
            "bit_rate": "127654",
            "nb_frames": "302883",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0
            },
            "tags": {
                "creation_time": "2012-02-09 07:58:16",
                "language": "eng",
                "handler_name": "Sound Media Handler"
            }
        }
    ],
    "format": {
        "filename": "/home/re/public_html/media/videos/mp4/130.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "6461.504000",
        "size": "1235816140",
        "bit_rate": "1530066",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "0",
            "compatible_brands": "isommp41",
            "creation_time": "2012-02-09 07:58:16"
        }
    }
}
root@cpanel [/home/re/public_html/modules/video/scripts]# 

This opens so many posibilities :PPPPPPPPP


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#2 2013-12-03 01:31:19

xpornclub
Member
From: California
Registered: 2012-01-01
Posts: 445
Website

Re: ffmpeg is a beauty :-)

So what is now possible with this?

Offline

#3 2013-12-03 12:04:24

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: ffmpeg is a beauty :-)

great, you can select every detail now smile


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#4 2013-12-03 12:08:38

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: ffmpeg is a beauty :-)

@xpornclub: instead of parsing the ffmpeg string with regex (which works in most cases, but with weird files doesnt) you get all the info you need. Also ffmpeg now has qt-faststart included (so that isnt required anymore).


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2013-12-03 20:40:55

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: ffmpeg is a beauty :-)

I think is better to have all videos in mp4.
But 80% of the sponsors have flv, is there a way to convert them to mp4 without loosing quality? now that we take all the file info.

On the other hand fast forward on mp4 is very slow on big files. I have this problem with my video CDN also.


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#6 2013-12-04 00:21:38

Nuevolab
Member
Registered: 2012-08-01
Posts: 189

Re: ffmpeg is a beauty :-)

1.
Video always loose some of quality on each reencoding attempt, though in most cases people may not even see the difference.
2.
Calculation for frame to jump and time offset for h264/mp4 video is of course much more complicated than for FLV, but it should not decide of visible delay in load time. These are just milliseconds. So if fast forward for mp4 is slower for you the reason must be server related.
It happens that mimetype is not configured properly on server and video file called by player is ""application/octet-stream" mimetype instead of "video/mp4".
On most servers it doesn't make any difference, but on some it does.

Both FLV and MP4 should have information about keyframes properly inserted and located. For FLV this is usally flvtool2 or yamdi that does the trick, for MP4 in case of ASP script this is  moovrelocator script which moves mp4 movie header atom (an mvhd atom) to the beginning of the mp4 file.
The MOOV atom acts as an index of the video data. It is here that the MPEG-4 muxer stores information about the file to enable the viewer to play and scrub the file. The file will not start to play until the player can access this index.
The moov atom is normally stored at the end of the file. So you can't scrub video until entire mp4 file is loaded. That's why there are scripts like moovrelocator or mp4box that move such atom to the beginning of the file so scrubbing video is possible immediately when video starts.
Detailed information about MP4 MOOV atom you can find at Adobe resources
http://www.adobe.com/devnet/video/artic … _atom.html

On mobile devices and tablets (concern only mp4 mobile videos) fast forward works different than for flash player. This is always html5 built-in video player using built-in HLS type of streaming and it can be even slower with scrubbing to time position than flash streaming. This is quite different method but you can't change it as it's the only built-in method for such devices.

Last edited by Nuevolab (2013-12-04 11:21:22)

Offline

Board footer

Powered by FluxBB