Open x674 opened 2 years ago
Please help me how to get rid of reflective characters in the filter? I am trying to make such a filter . -vf "scale=trunc(iw/2)2:trunc(ih/2)2" But in the final line, escape characters are added to the argument.
import ffmpeg stream = ffmpeg.input('D:\\Projects\\Python\\webmBotPython\\16468991399960.webm') stream = ffmpeg.filter(stream, 'scale', 'trunc(iw/2)*2:trunc(ih/2)*2') stream = ffmpeg.output(stream, 'D:\\Projects\\Python\\webmBotPython\\1.mp4',vcodec='h264_nvenc') ffmpeg.compile(stream)
Output string
['ffmpeg', '-i', 'D:\\Projects\\Python\\webmBotPython\\16468991399960.webm', '-filter_complex', '[0]scale=trunc(iw/2)*2\\\\\\\\\\\\:trunc(ih/2)*2[s0]', '-map', '[s0]', '-vcodec', 'h264_nvenc', 'D:\\Projects\\Python\\webmBotPython\\1.mp4']
Although I expect to see
['ffmpeg', '-i', 'D:\\Projects\\Python\\webmBotPython\\16468991399960.webm', '-filter_complex', '[0]scale=trunc(iw/2)*2:trunc(ih/2)*2[s0]', '-map', '[s0]', '-vcodec', 'h264_nvenc', 'D:\\Projects\\Python\\webmBotPython\\1.mp4']
I just had the same problem. This should do the trick:
ffmpeg.filter(stream, 'scale', 'trunc(iw/2)*2','trunc(ih/2)*2')
Please help me how to get rid of reflective characters in the filter? I am trying to make such a filter . -vf "scale=trunc(iw/2)2:trunc(ih/2)2" But in the final line, escape characters are added to the argument.
Output string
Although I expect to see