[FFmpeg-user] Hello, I want to ask about sending very long argument into ffmpeg command line.

김민성 spongbob9876 at naver.com
Tue Nov 5 09:55:58 EET 2019

Ok, let me explain in details.
I have to split one video into large amount(usually more than 1000) of segments and reassemble segments into one video. 
Suppose I try split only, then command will be like
ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:00:00 -t 00:01:00 -sn test_split001.mp4 -vcodec copy -acodec copy -ss 00:01:00 -t 00:02:00 -sn test_split002.mp4 -vcodec copy -acodec copy -ss 00:02:00 -t 00:13:50 -sn test_split003.mp4 -vcodec copy -acodec copy -ss 00:13:50 -t 00:19:27 -sn test_split004.mp4 ...
Currently I am sending just one command per extraction to the kernel, because kernel doesn't accept if given command is too long. 
Since I am making too many segments, efficiency is way too low.
This is why I asked you about modifying main(generating command arguments inside of main function). Did my answer cleared your question?
Thanks for reading this,
Minsung Kim
-----Original Message-----
From: "Ted Park"<kumowoon1025 at gmail.com>
To: "FFmpeg user questions"<ffmpeg-user at ffmpeg.org>;
Sent: 2019-11-05 (화) 15:54:16 (GMT+09:00)
Subject: Re: [FFmpeg-user] Hello, I want to ask about sending very long argument into ffmpeg command line.
> Hello. My name is Minsung Kim, I want to ask about sending very long arguments into ffmpeg command line.
> Since Linux kernel can't handle very long arguments, I am thinking steps below.
> - Rename current "main" function from source code to "main2".
> - Make new "main" function, and generate long arguments in that function.
> - Pass that arguments into main2.
> Is this a good way to solve it? If I have to change more part of code, where should I change it?

What are the “very long arguments”? If most of it’s a filter chain you can separate that into a file.
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org

To unsubscribe, visit link above, or email
ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list