Open gj94gj94ao4 opened 5 years ago
I'm converting this to a feature request / enhancement.
filter_complex_script
is not yet supported but could be implemented at some point.
(PRs are welcome)
I think it would be something like
stream.run(script_filename='some_script_file')
.. or ..
stream.run(use_script_tmpfile=True)
.. the latter of which automatically determines a temporary script filename and then deletes it when the processing is complete.
But this functionality does not exist yet.
AFAICT, if your command line arguments are getting too long then this is basically what's needed in order to get around the issue.
However, you may still run into issues with command line arguments being too long if you have a lot of input files, because the input filenames probably have to encoded on the command-line either way, even when using filter_complex_scriptfile
.
But it'd be good to get support for filter_complex_scriptfile
at some point anyways.
On Linux with huge filter chains, I managed to hit the argument length and get this error:
OSError: [Errno 7] Argument list too long: 'ffmpeg'
I tried bumping the stack size with:
resource.setrlimit(resource.RLIMIT_STACK, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
but it did not change anything.
I worked around this by getting the ffmpeg command with ffmpeg.compile(...
, writing the filter chain to a temporary file, and then modifying the ffmpeg command to use -filter_complex_script
and reference the file.
However, you may still run into issues with command line arguments being too long if you have a lot of input files, because the input filenames probably have to encoded on the command-line either way, even when using filter_complex_scriptfile.
Would using the movie
filter a good solution here? https://ffmpeg.org/ffmpeg-filters.html#movie-1
I haven't tried it, but it seems like we can define input sources within the filter graph, sidestepping the issue entirely.
I create some code to split and concat with my scenes like below
and when my scenes goes too many system return
And i found ffmpeg has -filter_complex_script is there any way to use that?
sorry for my poor English. :P