ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

a `split` filter is probably required

Open SerkanBeyaz opened this issue 4 years ago • 1 comments

Hello ffmpeg-python friends,

I have been learning ffmpeg-python for two days. So, please be tolerant.

In the following code, I am intending to -add a text to the video, and -copy this video to another video, and add another text below the first one

Here is my code:

`import ffmpeg

input_vid = ffmpeg.input('input_video.mp4')

#write "Hello World!" at a bottom position vid1 = ffmpeg.filter_(input_vid,'drawtext', x=25, y=275, fontfile="fonts/Lato/lato-regular.ttf",text='Hello World!',box='1', boxcolor='0x00000000@1', fontcolor='white') #

#write "How are you?" right under "Hello World!" #So, this video segment will have the both texts vid2 = ffmpeg.filter_(vid1,'drawtext', x=25, y=300, fontfile="fonts/Lato/lato-regular.ttf",text='How are you?',box='1', boxcolor='0x00000000@1', fontcolor='white')

#join the two videos joined = ffmpeg.concat(vid1, vid2).node

output = ffmpeg.output(joined[0], 'output_video.mp4') output.run()`

I get the following Error:

ValueError: Encountered drawtext(box='1', boxcolor='0x00000000@1', fontcolor='white', fontfile='fonts/Lato/lato-regular.ttf', text='Hello World!', x=25, y=275) with multiple outgoing edges with same upstream label None; a split filter is probably required

The same error is reported for "drawbox" command. However, I was not able to transfer the explanation for that situation to this one.

I appreciate any help.

SerkanBeyaz avatar Apr 20 '21 19:04 SerkanBeyaz

I had the same issue, i was duplicating some input video so i was able to solve it by making sure the input paths are unique

steinathan avatar Nov 08 '24 11:11 steinathan