I am using the ffmpeg library with python to add subtitles and a video as an overlay to a background still image. This code is working fine, but I want to use the afade parameter. The code without the afade parameter works fine. However, when I add the afade code in, I am getting the error.
Error
Unrecognized option 'af fade=t=out:st=10:d=2'.
Error splitting the argument list: Option not found
Code
try:
subprocess.check_call([
'ffmpeg',
'-i', source_file,
'-i', padding_image_file,
'-filter_complex',
'[0:v]scale=iw/'+ video_scale + ':ih/' + video_scale + ',setsar=1[main];'
'[1:v]scale=720:1280[pad];'
'[pad][main]overlay=' + video_overlay_x + ':'+ video_overlay_y + ',subtitles=' + subtitles_file + ':force_style=\'Alignment=6,OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=8,MarginL=2,MarginV=20\'',
'-c:a', 'copy', '-af "afade=t=out:st=14.2:d=0.8"', '-crf', '20', '-preset', 'fast', '-movflags', '+faststart',
'-y', output_file
])
I have tried multiple options and ways to using this -af in different ways but am still getting the "option not found" error.
'-c:a', 'copy', '-af', 'afade=t=out:st=14.2:d=0.8', '-crf',?Filtergraph 'afade=t=out:st=14.2:d=0.8' was defined for audio output stream 0:1 but codec copy was selected. Filtering and streamcopy cannot be used together.. I am assuming this means that I am trying to combine the wrong outputs?