Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • iPad Doesn't Render H.264 Video with HTML5

    5 octobre 2011, par jgoldberg

    I have some H.264-encoded videos which render in HTML5 correctly in the web browser, but do not render correctly on the iPad. When I use a H.264 video I downloaded off the internet, my video renders correctly on the iPad, so it is not an HTML problem.

    Here is the ffmpeg info about my videos --

    My original .mov video:

    Seems stream 1 codec frame rate differs from container frame rate: 6000.00 (6000/1) -> 30.00 (30/1)

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a_video.mp4':

    Metadata:

    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    

    Duration: 00:00:42.74, start: 0.000000, bitrate: 220 kb/s

    Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 94 kb/s
    Stream #0.1(eng): Video: h264, yuv420p, 762x464, 122 kb/s, 30 fps, 30 tbr, 3k tbn, 6k tbc
    

    After using Handbrake to convert my .mov to a mp4, yet doesn't render on the iPad:

    Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 29.97 (30000/1001)

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a_video.m4v':

    Metadata:

    major_brand     : mp42  
    minor_version   : 0
    compatible_brands: mp42isomavc1  
    encoder: HandBrake 0.9.5 2011010300  
    

    Duration: 00:00:42.77, start: 0.000000, bitrate: 169 kb/s

    Stream #0.0(und): Video: h264, yuv420p, 752x464 [PAR 381:376 DAR 381:232], 35 kb/s, PAR 145161:141376 DAR 145161:87232, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 128 kb/s

    Here is a .mp4 I found online which does render on the iPad:

    Seems stream 1 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 25.00 (25/1)

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a_video_3_emu.mp4':

    Metadata: major_brand : M4VP
    minor_version : 1
    compatible_brands: M4VPM4A mp42isom
    encoder : CoreMediaAuthoring 677, CoreMedia 420.17, i386

    Duration: 00:01:38.01, start: 0.000000, bitrate: 1023 kb/s

    Stream #0.0(und): Audio: aac, 32000 Hz, mono, s16, 97 kb/s
    Stream #0.1(und): Video: h264, yuv420p, 480x360 [PAR 1:1 DAR 4:3], 914 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc

    Does anyone see something wrong with the way I am encoded my videos?

    Edit

    At first my theory was that the iPad was sensitive to different container formats; but that appears not to be the case. I took a video which does render correctly on the iPad and converted it to a .mov, and it still played correctly on the iPad. So there must be a problem with how the iPad deals with the underlying H.264 stream.

  • How to display and capture webcam stream at the same time ? [migrated]

    5 octobre 2011, par 12hys

    This command works perfectly for saving a webcam stream to a file:

    ffmpeg -f alsa -i default -itsoffset 00:00:00 -f video4linux2 -s 1280x720 -r 25 -i /dev/video0  out.avi
    

    How would I simultaneously display this captured stream on my computer screen?

  • A way to convert bitrate/format of audio files (between upload & storage to S3)

    5 octobre 2011, par Jonathan Coe

    Currently using PHP 5.3.x & Fedora

    Ok. I'll try to keep this simple. I'm working on a tool that allows the upload & storing of audio files on S3 for playback. Essentially, the user uploads a file (currently only allowing mp3 & m4a) to the server, and the file is then pushed to S3 for storage via the PHP SDK for amazon aws.

    The missing link is that I would like to perform a simple bitrate & format conversion of the file prior to uploading the file. (ensuring that all files are 160kbs and .mp3).

    I've looked into ffmpeg, although it seems that the PHP library only allows for reading bitrates and other meta, not for actual conversion.

    Does anyone have any thoughts on the best way to approach this? Would running a shell_exec() command that performs the conversion be sufficient to do this, or is there a more efficient/better way of doing this?

    Thanks in advance! Any help or advice is much appreciated.

  • DirectShow RTSP SourceFilter with MPEG-4 Video Stream

    5 octobre 2011, par 6.45.Vapuru

    I create a simple direct show source filter using FFmpeg.I read rtp packets from RTSP source and give them to decoder. It works for h264 stream.

    MyRtspSourceFilter[H264 Stream] ---> h264 Decoder --> Video Renderer
    

    The bad news is that it does not work for MPEG-4. I can able to connect my rtsp source filter with MPEG-Decoder. I got no exception but video renderer does not show anything. Actually just show one frame then nothing [just stop]... Decoders and Renderers are 3rd party so i can not debug them.

    MyRtspSourceFilter[MP4 Stream] ---> MPEG-4 Decoder --> Video Renderer
    

    I can able to get rtp packets from MPEG-4 RTSP Source using FFmpeg sucessfully.There is no problem with it.

    It seems that i have not set something(?) in my Rtsps Source Filter which is not necessary for H264 stream but may be important for MPEG-4 stream

    What may cause this h264 stream and MPEG-4 stream difference in a direct show rtsp source filter? Any ideas.

    More Info:

    -- First i try some other rtsp source filters for MPEG-4 Stream...Although my rtsp source is same i see different subtypes in their pin connections.

    -- Secondly i realy get suspicious if the source is really MPEG-4 SO i check with FFmpeg...FFmpeg gives the source codec id as "CODEC_ID_MPEG4".

    Update: [ Hack ]

    I just set m_bmpInfo.biCompression = DWORD('xvid') it just worked fine...But it is static. How to dynamically get/determine this value using ffmpeg or other ways...

  • What is the minimum buffer size needed to initialize .ts (transport stream) file using FFMPEG

    5 octobre 2011, par user783692

    I can play .ts files using FFMPEG by passing full file. Now I have to play .ts as a buffer. Now I'm reading a ts file say 188*200 means 200 packets. Can anybody tell me what is minimum buffer size or minimum number packets needed to initialize ts playback.