Open Saturnix opened 4 years ago
.. one reason is: your audio needs an 'atrim' filter rather than 'trim'. 'atrim' is not part of the API so you need to call .filter('atrim', ...). The atrim filter does not accept frames but samples. You need to use times to trim video und audio in sync.
My experience: debug a filter chain on the command line and the translate back to ffmpeg-python.
-- Bid
Hi @Saturnix , wondering if you had found a solution here to the error?
ValueError: Encountered trim(end_frame=1000, start_frame=0) <17c7b86357ec> with multiple outgoing edges with same upstream label None; a split filter is probably required
@gondolio
Does this help?
https://stackoverflow.com/questions/60123218/ffmpeg-python-trim-and-concat-doesnt-work
Thanks @Saturnix , I did indeed end up doing something similar. Basically I refactored my code so that all the various functions I defined always take in two streams (audio/video) and return (at least) two streams (audio/video). Then only at the very end of the code do I concat them.
It works, but is more of a workaround than a proper solution in my opinion.
Apologies if this is trivial but I'm new to FFmpeg and I'm trying to follow the documentation but it appears as if it's written in another language.
I have two files,
in.mp4
andoutro.mp4
.I need a very simple thing: trim
in.mp4
to an arbitrary lenght, and concatoutro.mp4
after it.I can do that without the trimming part
But if I add the trimming here:
main_video = ffmpeg.input('in.mp4').trim(start_frame=0, end_frame=1000)
I get this error:
and if I try to do it here:
I get these errors:
How can I solve this?