Support for concat 'demuxer' instead of concat filter?
Created by: ahshah
Hi folks,
Thank you for creating ffmpeg-python! I'm running a very simple concat operator using ffmpeg-python like so:
def concatVideos(args):
files = []
streams =[]
for fileName in os.listdir(args.directorySrc):
files.append(fileName)
fileName = os.path.join(args.directorySrc, fileName)
for f in files:
streams.append(ffmpeg.input(fileName))
dest = '/home/user/full.mp4'
ffmpeg.concat(*streams).output(dest).run()
And its running super slow, here is the output i see from my script:
[Parsed_concat_0 @ 0x560af8a22460] Buffer queue overflow, dropping.=6348.7kbits/s speed=0.324x
Last message repeated 17 times
[Parsed_concat_0 @ 0x560af8a22460] Buffer queue overflow, dropping.=5929.5kbits/s speed=0.328x
Last message repeated 29 times
[Parsed_concat_0 @ 0x560af8a22460] Buffer queue overflow, dropping.=6091.4kbits/s speed=0.335x
When I run the same concatenation from command line:
$ cat /tmp/filelist
file '/mnt/smb/src/18.10.27_121205.mp4'
file '/mnt/smb/src/18.10.27_123438.mp4'
file '/mnt/smb/src/18.10.27_131923.mp4'
$ ffmpeg -f concat -safe 0 -i /tmp/filelist -c copy full.mp4
I get a much faster operation:
frame=10218 fps=2243 q=-1.0 Lsize= 522251kB time=00:02:50.43 bitrate=25101.8kbits/s speed=37.4x
Turns out the command line version is using the concat 'demuxer' which is significantly faster, this is documented here: https://trac.ffmpeg.org/wiki/Concatenate Curious if ffmpeg-python has any support for this type of speedy operation :)