[FFmpeg-user] Issues with video and audio streams not starting at beginning of file when using filter_complex.

ac83 acloutier at c-spanarchives.org
Thu Jul 31 23:14:32 CEST 2014


Lou-2 wrote
> On Wed, 30 Jul 2014 07:17:40 -0700 (PDT)
> ac83 <

> acloutier@

> > wrote:
> 
>> Hello, We're testing out some transcoding using filter_complex, but can't
>> seem to produce video that both starts on an I-frame and starts at the
>> same
>> time as the audio. In the past we've just done -ss x -i ... -t y and
>> things
>> have worked, but with filter_complex we're consistently seeing the audio
>> start before the video which causes our video streaming server to play
>> them
>> out of sync. I've tried a large variation of commands.. using trim and
>> atrim
>> w/ and w/out setpts etc..
>> 
>> ffmpeg -y  -ss 21 -i
>> /var/scratch/processRaw/f/20140729154103013_hd.trp/20140729154103013_hd.trp
> [trimmed]
> 
> This is quite the command and filtergraph. Could you provide the most
> simple command and console output that still has the issue? Try to
> narrow down the culprit. How can we reproduce the issue? Does it occur
> only with specific inputs? What player are you using?
> _______________________________________________
> ffmpeg-user mailing list

> ffmpeg-user@

> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Sure, here it is with only one output format

Also a link to the output file:
http://s3.amazonaws.com/dropbox.c-spanarchives.org/20140729154103013_hd.MP4-M10.mp4
And the source file:
http://s3.amazonaws.com/dropbox.c-spanarchives.org/20140729154103013_hd.trp

The streaming server that has issues with these files is Wowza. In the past
when we've created files with this issue (before we knew to put the -ss
before the -i) I believe we would also see the issue in Windows Media
Player.

To clarify the issue: it looks like the output video does start on a
keyframe, but the audio starts earlier than the video in the file. Wowza
starts playing the audio and video at the same time so they aren't synced.  

/opt/ffmpeg/2.2.4/bin/ffmpeg -y  -ss 1 -i
/var/scratch/processRaw/f/20140729154103013_hd.trp/20140729154103013_hd.trp
\
	-i /proj/common/resources/bug-green2.png \
	-filter_complex '[0:v]yadif[deinterlaced],
		[0:a]volume=15.9dB[audio],
		[deinterlaced][1:v]overlay=main_w-521:main_h-243[out],
		[out]split=1[outA],
		[outA]scale=1024:576[A],
		[audio]asplit=1[audioA]'\
	 -map [A] -map [audioA] -preset veryfast -profile:v main -level 3.1 -r
29.97 -qmin 4 -crf 28 -movflags faststart -vcodec libx264 -pix_fmt yuv420p
-acodec libfaac -t 30 -ar 44100 -ac 2 -b:a 128k -maxrate 500k -bufsize 1500k
-g 89.91 -threads 0
/var/scratch/processRaw/f/20140729154103013_hd.trp/20140729154103013_hd.MP4-M10.mp4
\
	
ffmpeg version 2.2.4 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 16 2014 10:02:25 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/opt/ffmpeg/2.2.4
--extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
--extra-libs=-ldl --enable-gpl --enable-nonfree --enable-pic --disable-debug
--disable-encoder=nellymoser --enable-postproc --enable-swscale
--enable-libmp3lame --enable-pthreads --enable-libfaac --enable-libx264
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x1aae9c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1aae9c0] decode_slice_header error
[h264 @ 0x1aae9c0] no frame!
[h264 @ 0x1aae9c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1aae9c0] decode_slice_header error
[h264 @ 0x1aae9c0] no frame!
[h264 @ 0x1aae9c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1aae9c0] decode_slice_header error
[h264 @ 0x1aae9c0] no frame!
[h264 @ 0x1aae9c0] mmco: unref short failure
    Last message repeated 1 times
[mpegts @ 0x1aaa880] PES packet size mismatch
Input #0, mpegts, from
'/var/scratch/processRaw/f/20140729154103013_hd.trp/20140729154103013_hd.trp':
  Duration: 00:05:09.61, start: 78099.700589, bitrate: 9395 kb/s
  Program 4 
    Stream #0:0[0x133]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k
tbn, 59.94 tbc
    Stream #0:1[0x134](eng): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 128 kb/s (clean effects)
Input #1, image2, from '/proj/common/resources/CSPAN-bug-green2.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: png, rgba, 425x75 [SAR 2835:2835 DAR 17:3], 25 tbr,
25 tbn, 25 tbc
[libx264 @ 0x1ad04c0] using SAR=1/1
[libx264 @ 0x1ad04c0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x1ad04c0] profile Main, level 3.1
[libx264 @ 0x1ad04c0] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft
2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=1
deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=0 threads=18 lookahead_threads=4
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=1 keyint=90 keyint_min=9 scenecut=40
intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=28.0 qcomp=0.60 qpmin=4
qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1500 crf_max=0.0 nal_hrd=none
filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to
'/var/scratch/processRaw/f/20140729154103013_hd.trp/20140729154103013_hd.MP4-M10.mp4':
  Metadata:
    encoder         : Lavf55.33.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
1024x576 [SAR 1:1 DAR 16:9], q=4--1, max. 500 kb/s, 11988 tbn, 29.97 tbc
(default)
    Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 44100 Hz,
stereo, s16, 128 kb/s (default)
Stream mapping:
  Stream #0:0 (h264) -> yadif
  Stream #0:1 (aac) -> volume
  Stream #1:0 (png) -> overlay:overlay
  scale -> Stream #0:0 (libx264)
  asplit -> Stream #0:1 (libfaac)
Press [q] to stop, [?] for help
[h264 @ 0x47c3320] reference picture missing during reorder
[h264 @ 0x47c3320] Missing reference picture, default is 65470
[h264 @ 0x485aa80] mmco: unref short failure
[h264 @ 0x4c7f520] reference picture missing during reorder
[h264 @ 0x4c7f520] Missing reference picture, default is 65486
[h264 @ 0x4d16d80] mmco: unref short failure
[h264 @ 0x4d16d80] Reference 4 >= 2   45kB time=00:00:01.78 bitrate=
205.5kbits/s dup=36 drop=0    
[h264 @ 0x4d16d80] error while decoding MB 60 2, bytestream 84155
[h264 @ 0x4d16d80] concealing 7909 DC, 7909 AC, 7909 MV errors in B frame
[h264 @ 0x4c7f520] concealing 380 DC, 380 AC, 380 MV errors in B frame
[h264 @ 0x4a213a0] reference picture missing during reorder
    Last message repeated 1 times
[h264 @ 0x4a213a0] Missing reference picture, default is 65742
    Last message repeated 1 times
[h264 @ 0x4ab8c00] mmco: unref short failure
[h264 @ 0x472bbc0] reference picture missing during reorder bitrate=
313.1kbits/s dup=36 drop=0    
[h264 @ 0x472bbc0] Missing reference picture, default is 65758
[h264 @ 0x47c3320] mmco: unref short failure
[mp4 @ 0x1acfae0] Starting second pass: moving the moov atom to the
beginning of the filedrop=0    
frame=  900 fps=114 q=-1.0 Lsize=    1386kB time=00:00:30.00 bitrate=
378.4kbits/s dup=38 drop=0    
video:985kB audio:367kB subtitle:0 data:0 global headers:0kB muxing overhead
2.446416%
[libx264 @ 0x1ad04c0] frame I:10    Avg QP:26.62  size: 34776
[libx264 @ 0x1ad04c0] frame P:232   Avg QP:31.99  size:  2083
[libx264 @ 0x1ad04c0] frame B:658   Avg QP:37.19  size:   269
[libx264 @ 0x1ad04c0] consecutive B-frames:  1.6%  0.7%  6.7% 91.1%
[libx264 @ 0x1ad04c0] mb I  I16..4: 30.3%  0.0% 69.7%
[libx264 @ 0x1ad04c0] mb P  I16..4:  0.5%  0.0%  0.2%  P16..4: 10.7%  5.4% 
2.5%  0.0%  0.0%    skip:80.8%
[libx264 @ 0x1ad04c0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  2.1%  0.9% 
0.1%  direct: 0.2%  skip:96.7%  L0:34.7% L1:44.1% BI:21.2%
[libx264 @ 0x1ad04c0] coded y,uvDC,uvAC intra: 64.9% 62.4% 27.2% inter: 1.1%
0.3% 0.0%
[libx264 @ 0x1ad04c0] i16 v,h,dc,p: 18% 48% 18% 16%
[libx264 @ 0x1ad04c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 29% 14%  3%  8%  6% 
7%  6%  6%
[libx264 @ 0x1ad04c0] i8c dc,h,v,p: 46% 31% 16%  8%
[libx264 @ 0x1ad04c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1ad04c0] kb/s:268.57



--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Issues-with-video-and-audio-streams-not-starting-at-beginning-of-file-when-using-filter-complex-tp4666642p4666658.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list