[FFmpeg-user] ffmpeg producing garbled output / problems

Ray Larsen rayfreeagent at yahoo.com
Fri Dec 21 19:33:02 CET 2012


Sorry!

I had to snip some of the output for creating movie.mpg because of repeating "packet too large" and "buffer underflow" messages.

$ ffmpeg -ar 48000 -f s16le -ac 2 -i /dev/zero -loop 1 -i psa.tif -t 15 -r 29.97 -q:v 1 -c:v mpeg2video -c:a mp2 -vf "fade=in:0:30, fade=out:420:30" psa.mpg
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 16 2012 11:09:15 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[s16le @ 0x10200e800] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, s16le, from '/dev/zero':
  Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[image2 @ 0x10200f400] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #1, image2, from 'psa.tif':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: tiff, rgb24, 1920x1080, 25 tbr, 25 tbn, 25 tbc
[mpeg @ 0x102009e00] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'psa.mpg':
  Metadata:
    encoder         : Lavf54.29.104
    Stream #0:0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (tiff -> mpeg2video)
  Stream #0:0 -> #0:1 (pcm_s16le -> mp2)
Press [q] to stop, [?] for help
frame=  450 fps= 39 q=1.0 Lsize=    7134kB time=00:00:14.98 bitrate=3898.7kbits/s dup=74 drop=0    
video:6866kB audio:234kB subtitle:0 global headers:0kB muxing overhead 0.473428%

$ ffmpeg -loop 1 -i watermark.png -frames:v 1798 -vf "fade=in:0:30, fade=out:1768:30" -c:v png -pix_fmt rgba watermark.mov
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 16 2012 11:09:15 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[image2 @ 0x10200e800] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'watermark.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1080, 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, mov, to 'watermark.mov':
  Metadata:
    encoder         : Lavf54.29.104
    Stream #0:0: Video: png (png  / 0x20676E70), rgba, 1920x1080, q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (png -> png)
Press [q] to stop, [?] for help
frame= 1798 fps= 27 q=0.0 Lsize=   25323kB time=00:01:11.92 bitrate=2884.4kbits/s    
video:25315kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.030969%

$ ffmpeg -i main.mov -qscale:v 1 -c:v mpeg2video -vf "movie=watermark.mov [watermark]; [in][watermark] overlay=0:0 [out]" movie.mpg
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 16 2012 11:09:15 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'main.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2012-01-15 22:09:29
  Duration: 00:01:00.19, start: 0.000000, bitrate: 140997 kb/s
    Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, 1920x1080, 139434 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
    Metadata:
      creation_time   : 2012-01-15 22:09:29
      handler_name    : Apple Alias Data Handler
      timecode        : 01:09:35;24
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2012-01-15 22:09:29
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2012-01-15 22:10:24
      handler_name    : Apple Alias Data Handler
      timecode        : 01:09:35;24
[mpeg @ 0x10206fc00] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'movie.mpg':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.29.104
    Stream #0:0(eng): Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 2012-01-15 22:09:29
      handler_name    : Apple Alias Data Handler
      timecode        : 01:09:35;24
    Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      creation_time   : 2012-01-15 22:09:29
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (prores -> mpeg2video)
  Stream #0:1 -> #0:1 (pcm_s16le -> mp2)
Press [q] to stop, [?] for help
buffer underflow i=0 bufi=234323 size=242616me=00:00:01.98 bitrate=18351.6kbits/s    
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=234323 size=242616
    Last message repeated 1 times
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=234323 size=242616
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=236364 size=242616
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=236364 size=242616
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=238405 size=242616
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=238405 size=242616
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=240446 size=242616
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=240446 size=242616
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=242487 size=242616
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=242487 size=242616
buffer underflow i=0 bufi=234444 size=239195me=00:00:01.98 bitrate=27246.3kbits/s    
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=234444 size=239195
    Last message repeated 1 times
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=234444 size=239195

<SNIP - last message repeated>

[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=266414 size=270003
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=268455 size=270003
[mpeg @ 0x10206fc00] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x10206fc00] buffer underflow i=0 bufi=268455 size=270003
frame= 1804 fps= 12 q=1.0 Lsize=  325244kB time=00:01:00.20 bitrate=44254.7kbits/s    
video:323147kB audio:941kB subtitle:0 global headers:0kB muxing overhead 0.356663%

$ cat psa.mpg movie.mpg > out.mpg

$ ffmpeg -i out.mpg -c:v libx264 -preset slow -b:v 10800k -c:a libfaac -b:a 48k -pix_fmt yuv420p out.mp4
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 16 2012 11:09:15 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0x10200e800] max_analyze_duration 5000000 reached at 5005000
Input #0, mpeg, from 'out.mpg':
  Duration: 00:01:00.17, start: 0.989978, bitrate: 45252 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 104857 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
[libx264 @ 0x10200fa00] using SAR=1/1
[libx264 @ 0x10200fa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x10200fa00] profile High, level 5.0
[libx264 @ 0x10200fa00] 264 - core 129 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=10800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf54.29.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 10800 kb/s, 30k tbn, 29.97 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 48 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
  Stream #0:1 -> #0:1 (mp2 -> libfaac)
Press [q] to stop, [?] for help
frame= 2254 fps= 12 q=32766.0 Lsize=  114189kB time=00:01:15.22 bitrate=12435.8kbits/s    
video:113518kB audio:589kB subtitle:0 global headers:0kB muxing overhead 0.071899%
[libx264 @ 0x10200fa00] frame I:11    Avg QP:15.72  size:180205
[libx264 @ 0x10200fa00] frame P:632   Avg QP:19.00  size: 74227
[libx264 @ 0x10200fa00] frame B:1611  Avg QP:19.92  size: 41805
[libx264 @ 0x10200fa00] consecutive B-frames:  1.1%  3.0% 23.3% 72.6%
[libx264 @ 0x10200fa00] mb I  I16..4: 20.3% 76.6%  3.2%
[libx264 @ 0x10200fa00] mb P  I16..4:  5.5% 30.9%  1.2%  P16..4: 31.5%  5.5%  2.8%  0.0%  0.0%    skip:22.8%
[libx264 @ 0x10200fa00] mb B  I16..4:  0.5%  5.3%  0.3%  B16..8: 37.1%  4.1%  0.9%  direct: 4.5%  skip:47.5%  L0:47.8% L1:46.1% BI: 6.0%
[libx264 @ 0x10200fa00] final ratefactor: 17.52
[libx264 @ 0x10200fa00] 8x8 transform intra:83.6% inter:89.2%
[libx264 @ 0x10200fa00] direct mvs  spatial:87.0% temporal:13.0%
[libx264 @ 0x10200fa00] coded y,uvDC,uvAC intra: 69.9% 56.7% 12.6% inter: 20.6% 25.1% 1.2%
[libx264 @ 0x10200fa00] i16 v,h,dc,p: 10%  8%  7% 74%
[libx264 @ 0x10200fa00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9%  7% 26%  8% 11% 10% 10%  8% 10%
[libx264 @ 0x10200fa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12%  9% 14%  9% 13% 12% 11%  9% 10%
[libx264 @ 0x10200fa00] i8c dc,h,v,p: 41% 32% 21%  6%
[libx264 @ 0x10200fa00] Weighted P-Frames: Y:2.2% UV:1.1%
[libx264 @ 0x10200fa00] ref P L0: 47.6% 10.6% 20.7%  8.5%  9.2%  3.4%  0.0%
[libx264 @ 0x10200fa00] ref B L0: 85.0%  9.9%  3.5%  1.6%
[libx264 @ 0x10200fa00] ref B L1: 96.0%  4.0%
[libx264 @ 0x10200fa00] kb/s:12364.74






________________________________
 From: Roger Pack <rogerdpack2 at gmail.com>
To: FFmpeg user questions <ffmpeg-user at ffmpeg.org> 
Sent: Friday, December 21, 2012 7:45 AM
Subject: Re: [FFmpeg-user] ffmpeg producing garbled output / problems
 
On 12/20/12, Ray Larsen <rayfreeagent at yahoo.com> wrote:
> I am a newbie to ffmpeg and I am not getting the results I need, no matter
> what I try.
>
> I have three inputs, all are 1920 x 1080:
>
> psa.tif - A TIFF file with a static graphic
> watermark.png - A transparent PNG with a logo in the lower right corner
> main.mov - A movie clip, ProRes encoded
>
> I want to:
>
> Create a 15 second movie clip from psa.tif which fades in at the beginning
> and out at the end
> Apply watermark.png (with a fade in at the beginning and a fade out at the
> end) to main.mov
> Combine psa and watermarked main and encode with H.264 and AAC.
>
> Here's what I have so far:
>
> Create a 15 second clip from psa.tif
>
> ffmpeg -ar 48000 -f s16le -ac 2 -i /dev/zero -loop 1 -i psa.tif -t 15 -r
> 29.97 -q:v 1 -c:v mpeg2video -c:a mp2 -vf "fade=in:0:30, fade=out:420:30"
> psa.mpg
>
> Create a watermark
>
> ffmpeg -loop 1 -i watermark.png -frames:v 1798 -vf "fade=in:0:30,
> fade=out:1768:30" -c:v png -pix_fmt rgba watermark.mov
>
> Apply the watermark to main.mov
>
> ffmpeg -i main.mov -qscale:v 1 -c:v mpeg2video -vf "movie=watermark.mov
> [watermark]; [in][watermark] overlay=0:0 [out]" movie.mpg
>
> Concatenate
>
> cat psa.mpg movie.mpg > out.mpg
>
> Encode
>
> ffmpeg -i out.mpg -c:v libx264 -preset slow -b:v 10800k -c:a libfaac -b:a
> 48k -pix_fmt yuv420p out.mp4
>
>
> The fades don't work at all and the final encoded MP4 plays garbled in VLC
> player and Quicktime Player and it won't play at all in Windows Media
> Player.

full uncut command line and console output please? (so we can see what
version of ffmpeg you're using...)
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list