Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg mozilla mp3 to webm encoding issue

    30 octobre 2011, par Jaggu

    I want to encode my mp3 file into webm format so that it can be played in Firefox using HTML5 natively.

    This is the file that is converted format using ffmpeg using command:

    http://www.filesonic.in/file/2825764155

    ffmpeg -i test.mp3 -ab 128k test.webm
    

    The file gets converted successfully and I can play in firefox and chrome using HTML5's native audio feature.

    However problem is in FF when I want to jump to a particular second using slider it doesn't work anymore. It just stops playing. This problem doesn't occur in chrome etc.

    What can be the issue?

    Update: I tested in FF 7.0.1 and it still doesn't work.

  • Windows media player showing wrong bit rate

    30 octobre 2011, par Akash

    I used ffmpeg to change the bit rate of a .mp3 file from 128kbps to 64kbps

    here are the final lines of output of ffmpeg:

    size=    2261kB time=00:04:49.38 bitrate=  64.0kbits/s
    video:0kB audio:2261kB global headers:0kB muxing overhead 0.011274%
    

    Tough the file size is reduced by half, windows media player while playing the file shows the bit-rate is 159 K bits/second

    Any ideas on why is this so?

  • Getting incorrect output resolution ffmpeg

    29 octobre 2011, par Adam

    I am capturing an RTSP stream from a security camera, and transcoding it for (live streaming) to iphone, using OSX as the encoding platform. I have it working correctly, and Im tuning it. However, it seems that it is not outputting the requested resolution. This is my script

    /Applications/SecurityCamera/openRTSP -v -c -t rtsp://10.0.1.118/ch1-s1 | \
        /Applications/SecurityCamera/ffmpeg \
        -r 10 -i - \
        -y -an -ab 64000 -f mpegts -vcodec copy -s 960x640 \
        -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 \
        -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16  -keyint_min 25 -sc_threshold 40 \
        -i_qfactor 0.71 -bt 400k -maxrate 524288 -bufsize 524288 \
        -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 \
        -aspect 960:640 -r 10 -g 10 -async 2 -\
        | /Applications/SecurityCamera/mediastreamsegmenter -b http://hydracam.dyndns.org:8080/ -f /Library/WebServer/Documents/ -i stream.m3u8 -t 10 -s 4 -D
    

    This is the status report:

    Input #0, h264, from 'pipe:':
    
      Duration: N/A, bitrate: N/A
      Stream #0.0: Video: h264, yuv420p, 1600x1200, 10 fps, 10 tbr, 1200k tbn, 20 tbc
      [mpegts @ 0x10100c200] muxrate VBR, pcr every 1 pkts, sdt every 200, pat/pmt every 40 pkts
      Output #0, mpegts, to 'pipe:':
      Metadata:
        encoder         : Lavf52.93.0
        Stream #0.0: Video: libx264, yuv420p, 1600x1200 [PAR 1:1 DAR 4:3], q=2-31, 90k tbn, 10 tbc
    Stream mapping:
      Stream #0.0 -> #0.0
    

    You can see that its working, but it is outputting 1600x1200 for some reason.

    If I change the -vcodec copy to -vcodec libx264 then I get the correct status report (stating 960x640, correct), but the streaming halts after 54 frames (see output below)

    Seems stream 0 codec frame rate differs from container frame rate: 20.00 (20/1) -> 10.00 (20/2)
    Input #0, h264, from 'pipe:':
      Duration: N/A, bitrate: N/A
        Stream #0.0: Video: h264, yuv420p, 1600x1200, 10 fps, 10 tbr, 1200k tbn, 20 tbc
    [buffer @ 0x100d02420] w:1600 h:1200 pixfmt:yuv420p
    [scale @ 0x100d026f0] w:1600 h:1200 fmt:yuv420p -> w:960 h:640 fmt:yuv420p flags:0x4
    [libx264 @ 0x10100d400] using SAR=1/1
    [libx264 @ 0x10100d400] frame MB size (60x40) > level limit (1620)
    [libx264 @ 0x10100d400] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowCTZ SlowAtom
    [libx264 @ 0x10100d400] profile Constrained Baseline, level 3.0
    [mpegts @ 0x10100c200] muxrate VBR, pcr every 1 pkts, sdt every 200, pat/pmt every 40 pkts
    Output #0, mpegts, to 'pipe:':
      Metadata:
        encoder         : Lavf52.93.0
        Stream #0.0: Video: libx264, yuv420p, 960x640 [PAR 1:1 DAR 3:2], q=10-51, 200 kb/s, 90k tbn, 10 tbc
    Stream mapping:
      Stream #0.0 -> #0.0
    read pmap fffps=  3 q=37.0 size=      37kB time=0.10 bitrate=3008.0kbits/s    bits/s    
    video pid set at 100
    found sequence start
      next segment value 1026000
    written bytes 376 skipped 0
    frame=   54 fps=  2 q=-1.0 Lsize=     160kB time=5.40 bitrate= 242.0kbits/s    
    video:141kB audio:0kB global headers:0kB muxing overhead 12.872737%
    frame I:6     Avg QP:34.68  size: 23524
    [libx264 @ 0x10100d400] frame P:48    Avg QP:41.53  size:    75
    [libx264 @ 0x10100d400] mb I  I16..4: 63.9%  0.0% 36.1%
    [libx264 @ 0x10100d400] mb P  I16..4:  0.1%  0.0%  0.0%  P16..4:  0.8%  0.1%  0.0%  0.0%  0.0%    skip:99.0%
    [libx264 @ 0x10100d400] final ratefactor: 38.54
    [libx264 @ 0x10100d400] coded y,uvDC,uvAC intra: 57.7% 22.3% 2.0% inter: 0.0% 0.1% 0.0%
    [libx264 @ 0x10100d400] i16 v,h,dc,p: 23% 35% 27% 15%
    [libx264 @ 0x10100d400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 32% 16%  4%  3%  3%  7%  4%  8%
    [libx264 @ 0x10100d400] i8c dc,h,v,p: 83% 11%  5%  0%
    [libx264 @ 0x10100d400] kb/s:214.43
    
  • FFmpeg not encoding with libx264 library

    29 octobre 2011, par bOkeifus

    Hey people of StackOverflow. I have been having a strange issue that I'm not exactly sure what's going on. I am using FFmpeg to convert any incoming video files to h264 mp4 files using the libx264. This is the log that I get from running this line of code:

    ffmpeg -y -i vdoname.flv -acodec libfaac -vcodec libx264 -sameq vid.mp4
    

    This is the log output after running the line:

    FFmpeg version SVN-r13428, Copyright (c) 2000-2008 Fabrice Bellard, et al.
      configuration: --prefix=/usr --disable-static --enable-shared --enable-gpl --enable-nonfree --enable-pthreads --enable-liba52 --enable-liba52bin --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --disable-network --disable-ipv6 --disable-ffserver --disable-ffplay
      libavutil version: 49.6.0
      libavcodec version: 51.57.0
      libavformat version: 52.14.0
      libavdevice version: 52.0.0
      built on Feb 17 2009 09:01:13, gcc: 4.1.2 20071124 (Red Hat 4.1.2-42)
    
    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 49.92 (599/12)
    Input #0, flv, from '/html/video/937.flv':
      Duration: 00:00:10.08, start: 0.000000, bitrate: 48 kb/s
        Stream #0.0: Video: flv, yuv420p, 720x480, 49.92 tb(r)
        Stream #0.1: Audio: mp3, 22050 Hz, stereo, 48 kb/s
    Output #0, h264, to '/html/flvideo/new_937.mp4':
        Stream #0.0: Video: libx264, yuv420p, 720x480, q=2-31, 200 kb/s, 49.92 tb(c)
        Stream #0.1: Audio: libfaac, 22050 Hz, stereo, 64 kb/s
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    [libx264 @ 0x11d58b0]using cpu capabilities: MMX MMXEXT SSE SSE2 3DNow!
    Press [q] to stop encoding
    

    Can someone please help me out and tell me what to do to get this to work? I guessed that the libx264 external library is not installed but it doesn't exactly say that in the log file and it looks as if it does find it but then doesn't actually encode the video.

    Any and all help is greatly appreciated.

  • PHP detect if shell_exec() command failed

    28 octobre 2011, par Chad Whitaker

    I'm running the ffmpeg command within PHP's shell_exec() to convert several videos in a list. Is there anyway to detect if an error happened while the video was being converted (or atleast verify it fully completed the conversion)?

    I don't want to stop converting other videos if an error happens, just the ability to record the error.

    <?php
        shell_exec('ffmpeg -i downloads/flv/file1.flv -vcodec libvpx -acodec libvorbis downloads/webm/file1.webm');
    
        if(error) {
         //run a command here to report the error (ie. MySQL or email)
        }
    ?>