I've problem with certain mp4 files (and I cannot find exactly what kind of mp4) in concatenation without re encoding with the ffmpeg concat demuxer. The video of the second fragment is "broken". I cannot find differences with ffprobe to detect when I am in such a situation, being able to detect these unconcatenable mp4s will let me to force a re encoding... The problem occurs with all the ffmpeg versions I tried (3.1.x to 3.3.x), here are a small cut of a couple of files that trigger this behaviour: https://www.dropbox.com/s/jluqga0qldn01wq/samp01.mp4?dl=0 https://www.dropbox.com/s/674jnozulee5tkr/samp02.mp4?dl=0 concat.txt: file 'samp01.mp4' file 'samp02.mp4' ffmpeg -f concat -i concat.txt -c copy test.mp4 ffprobe report the samples to be of the same format/level/resolution (as they should be since they are two videos taken with the same camera): samp01: Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 7241 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 50 tbc (default) samp02: Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 7244 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default) -- *Bye,* * Gabriele Greco*
El 30/10/17 a las 07:51, Gabriele Greco escribió:
ffmpeg -f concat -i concat.txt -c copy test.mp4
I can confirm the file works fine with me. Here's my ffmpeg version: ffmpeg version N-87492-ge5799b5 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --enable-gpl --enable-shared --enable-gray --enable-runtime-cpudetect --enable-bzlib --enable-libfreetype --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libass --enable-libvpx --enable-libx264 --enable-libx265 libavutil 55. 76.100 / 55. 76.100 libavcodec 57.106.102 / 57.106.102 libavformat 57. 82.102 / 57. 82.102 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.106.100 / 6.106.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 -- Gonzalo Garramuño
ffmpeg -f concat -i concat.txt -c copy test.mp4
I can confirm the file works fine with me. Here's my ffmpeg version:
ffmpeg version N-87492-ge5799b5 Copyright (c) 2000-2017 the FFmpeg developers
Do you really see the video of "test.mp4" after sec 10? I've tried also with a git version updated just before posting the original message: ffmpeg version N-88289-g783535a4cd Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 9.0.0 (clang-900.0.38) ... just to be sure that the problem is not the platform I just tried it also in an ubuntu box with this version: ffmpeg version 3.3-1~16.04.york1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 ... with the same result. -- *Bye,* * Gabry*
El 30/10/17 a las 08:53, Gabriele Greco escribió:
ffmpeg -f concat -i concat.txt -c copy test.mp4
I can confirm the file works fine with me. Here's my ffmpeg version:
ffmpeg version N-87492-ge5799b5 Copyright (c) 2000-2017 the FFmpeg developers
Do you really see the video of "test.mp4" after sec 10?
Yes, I see the two matches. One after the other. -- Gonzalo Garramuño
El 30/10/17 a las 08:53, Gabriele Greco escribió:
ffmpeg version 3.3-1~16.04.york1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
I built latest head with same results. It works for me. ffmpeg version N-87492-ge5799b5 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --enable-gpl --enable-shared --enable-gray --enable-runtime-cpudetect --enable-bzlib --enable-libfreetype --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libass --enable-libvpx --enable-libx264 --enable-libx265 libavutil 55. 76.100 / 55. 76.100 libavcodec 57.106.102 / 57.106.102 libavformat 57. 82.102 / 57. 82.102 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.106.100 / 6.106.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 You might want to check the configure options to see they match yours. -- Gonzalo Garramuño
El 30/10/17 a las 08:53, Gabriele Greco escribió:
ffmpeg version 3.3-1~16.04.york1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 --
Sorry. I checked with the same version. I now properly updated ffmpeg and can still see it work with latest head. ffmpeg version N-88322-gbd76c42 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --enable-gpl --enable-shared --enable-gray --enable-runtime-cpudetect --enable-bzlib --enable-libfreetype --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libass --enable-libvpx --enable-libx264 --enable-libx265 libavutil 56. 0.100 / 56. 0.100 libavcodec 58. 1.100 / 58. 1.100 libavformat 58. 0.102 / 58. 0.102 libavdevice 58. 0.100 / 58. 0.100 libavfilter 7. 0.101 / 7. 0.101 libswscale 5. 0.101 / 5. 0.101 libswresample 3. 0.100 / 3. 0.100 libpostproc 55. 0.100 / 55. 0.100 -- Gonzalo Garramuño
Sorry. I checked with the same version. I now properly updated ffmpeg and can still see it work with latest head.
Any idea about the reason I get a different result from the one you get? Here is my output from the merge operation: https://www.dropbox.com/s/2uipfmdtl68d5pd/test.mp4?dl=0 you can playback this mp4 without problems? -- *Bye,* * Gabry*
El 30/10/17 a las 12:39, Gabriele Greco escribió:
Any idea about the reason I get a different result from the one you get?
Maybe it has to do with the use of the --enable-gpl option.
Here is my output from the merge operation:
https://www.dropbox.com/s/2uipfmdtl68d5pd/test.mp4?dl=0
you can playback this mp4 without problems?
I can't play that clip. -- Gonzalo Garramuño
Any idea about the reason I get a different result from the one you get?
Maybe it has to do with the use of the --enable-gpl option.
These are my flags: --disable-videotoolbox --disable-audiotoolbox --enable-libx264 --enable-libfdk-aac --enable-nonfree --enable-gpl .... but on the ubuntu machine it's a ppa version of ffmpeg, so the flags are different and in both --enable-gpl is present... --prefix=/usr --extra-version='1~16.04.york1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared -- *Bye,* * Gabry*
On Mon, Oct 30, 2017 at 17:19:56 +0100, Gabriele Greco wrote: Interesting, my ffmpeg build from master (but not quite HEAD, but rather a snapshot from Oct. 24th) can concatenate those files just fine. My other ffmpeg (3.3.4, different machine) can't. The problem exposes itself at the cut point. Neither ffplay nor mplayer display the badly concatenated file correctly from second 10.
Maybe it has to do with the use of the --enable-gpl option.
Most of ffmpeg's configure options deal with the available features, not how they operate. In this case, only the concat demuxer and the mp4 muxer are involved, neither of those should be changed by the presence of configure flags (these muxers are either there or not). Gabriele, can you try these versions on your Ubuntu machine?: https://johnvansickle.com/ffmpeg/ Both those git master HEAD and the 3.4 versions work for me as well (64 bit builds). I wouldn't rule out that 3.3.1 and 3.3.4 may have been faulty in this regard (I don't have the time to git bisect), but then I really can't explain why your build from git doesn't. :-/ Moritz
El 30/10/2017 a las 13:19, Gabriele Greco escribió:
Any idea about the reason I get a different result from the one you get?
Maybe it has to do with the use of the --enable-gpl option.
These are my flags:
--disable-videotoolbox --disable-audiotoolbox --enable-libx264 --enable-libfdk-aac --enable-nonfree --enable-gpl
I'll step aside and let someone else chime in. Send your ffmpeg --version as well as your ffmpeg command with full uncut console output so that someone else might help you out. -- Gonzalo Garramuño
2017-10-30 16:39 GMT+01:00 Gabriele Greco <gabriele.greco@wyscout.com>:
Any idea about the reason I get a different result from the one you get?
Here is my output from the merge operation:
This video was written with an old version of FFmpeg. I suggest you test current FFmpeg git head and report back. Carl Eugen
This video was written with an old version of FFmpeg.
I suggest you test current FFmpeg git head and report back.
Current git head works (but the one i had before do not), and release/3.4 works too, any older 3.x versions do not work (the second video is broken). I'm trying to move my base to release/3.4, but I still do not know what kind of problem it was! I hope not to introduce too many regressions, thanks for the support! -- Bye, Gabry
2017-10-30 13:28 GMT+01:00 Gonzalo Garramuño <ggarra13@gmail.com>:
ffmpeg version N-88322-gbd76c42 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --enable-gpl
--enable-shared
(This has an effect, I wonder if it is always wanted for current git head.)
--enable-gray
This also has an effect: It is supposed to slow down typical use-cases of libavcodec. But I haven't tested it for a long time: Did you?
--enable-runtime-cpudetect
This has no effect.
--enable-bzlib
This has no effect, not even the effect you believe it has. Carl Eugen
participants (4)
-
Carl Eugen Hoyos -
Gabriele Greco -
Gonzalo Garramuño -
Moritz Barsnick