0

I am trying to concat several webm files, adding blackframe gap between files.

Most files processed fine, but then I encountered problem. At some time in the output:

Input stream #1:1 frame changed from size:640x480 fmt:yuv420p to size:480x360 fmt:yuv420p frame= 8173 fps=109 q=0.0 size= 29580kB time=00:15:44.88 bitrate= 256.5kbits/s speed=12.6x
frame= 8173 fps=108 q=0.0 size= 29580kB time=00:15:44.88 bitrate= 256.5kbits/s speed=12.5x
frame= 8173 fps=107 q=0.0 size= 29580kB time=00:15:44.88 bitrate= 256.5kbits/s speed=12.4x

..and it repeats for hours until I kill ffmpeg. Full log https://pastebin.com/e8URCSec.

Command is

/home/vagrant/bin/ffmpeg -y -i file1.webm
-i file2.webm -f lavfi 
-i "color=c=black:s=640x480:r=25" 
-f lavfi -i anullsrc 
-filter_complex "[0:v]scale=640:480[scaled0]; [1:v]scale=640:480[scaled1]; 
[2]trim=duration=68.579[g0]; [3]atrim=duration=68.579[ga0]; 
[scaled0][0:a][g0][ga0][scaled1][1:a]concat=n=3:v=1:a=1" 
-cpu-used -5 -deadline realtime -threads 4 
output.webm 2> output.log

Yes I see message "frame changed from size", but that why I added scale filter. Without that filter there were errors and ffmpeg crashed.

Ffmpeg version is standard from Ubuntu 16.04 repository.

Please add comment if I should provide input files.

3
  • If you know the frame number, insert select='not(eq(n,N))' before the scale for the 2nd video. N is the frame #, starting from zero. If it's hard to identify, reverse the order of the two videos in the concat and see where it gets stuck.
    – Gyan
    Apr 15, 2017 at 16:34
  • @Mulvya thanks for advice. Probably it would be hard to automatically know bad frame number? Reason I'm asking is we need bunch of files processed. Want to avoid that kind of errors in future.
    – frutality
    Apr 15, 2017 at 17:31
  • 1
    Have you tried a more recent version of ffmpeg (a static build from the website)? The log doesn't seem to be from ffmpeg supplied with Ubuntu. In any case, submitting a bug report would make sense if you could supply the input file that shows the problem. As for your script, I would set a timeout when calling the command. If it never gets finished, you'd need to kill it and manually inspect what's going wrong.
    – slhck
    Apr 16, 2017 at 14:58

1 Answer 1

0

Well, I think I found workaround. I'm pretty sure problem is that source files have unsynced audio and video. I don't know the reasons, we got files from media server.

But there is workaround. First, we use scale filter on each file. And only after that we use concat. Then ffmpeg works fine.

We still have unsynced audio/video, but that's not ffmpeg problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .