[FFmpeg-user] Combining download of ts stream with geometry modification into mp4?
bo.berglund at gmail.com
Tue Apr 20 01:52:07 EEST 2021
On Mon, 19 Apr 2021 10:01:47 -0700, Carl Zwanzig <cpz at tuunq.com> wrote:
>On 4/19/2021 4:46 AM, Bo Berglund wrote:
>>> *assuming that the source is producing a ts which is captured as-is
>> I think that it is,
>Which would be easily answered by including the command output (which should
>have been in the initial email).
>Have you tried simply replacing
> -i <TSINFILE>
> -user_agent \"Mozilla\" -i <VIDEOURL> -t <CAPTURETIME>
>If that does not work, post the complete command and output (and don't use
>-hide_banner). And, of course, use a current build of ffmpeg.
Well after my last post I checked if just adding the second command arguments
after the input had been defined to be the stream it worked just like I want it
Here is the basics of the script I call from the at schedule at preset times
(I have removed input argument checking for clarity):
read VIDEOURL < $URLFILE #URLFILE contains the long URL to the 24 hour stream
CAPTURETIME="$1" #Time in second for the capture duration
TARGETFILE="$2" #The output file to store the video into, extension is .mp4
eval "ffmpeg -hide_banner -threads 1 -user_agent \"Mozilla\" -i $VIDEOURL -vf
scale=w=-4:h=360 -c:v libx264 -preset fast -crf 26 -c:a copy -t $CAPTURETIME
I think that the " -threads 1 " part does not work to reduce the CPU load,
When I check with top I get a load that varies between 35% and 80% for the
But when I check the thread count for that PID it gets above 20!
Anyway, the whole thing now works OK and I get the final file at the time the
scheduled task is supposed to end.
All in all I now have a working solution that does not slow me down for
geometry/size conversion after each download as it did before. And the mp4 file
size is OK too.
Developer in Sweden
More information about the ffmpeg-user