[FFmpeg-user] How to download and transcode video stream to mp4 and save the TS stream to file at the same time?

Bo Berglund bo.berglund at gmail.com
Sun Sep 29 22:59:02 EEST 2024


I have created a script that downloads Internet video streams (basically news
programs) and transcodes to mp4 format with a fixed windows size.
As soon as the video stream recording ends the mp4 file can be played.

I wonder if there is a way to let ffmpeg do two things at the same time:
- download as now but save the stream to a TS formatted file and:
- transcode to the mp4 format into a different output file

This would make it possible to start viewing the downloaded file in TS format
while the real output file remains unplayable until the download finishes and
the moov atom gets written.

I have found a similar question on SuperUser:
https://superuser.com/questions/757114/play-ffmpeg-while-downloading

But I don't understand how to adapt my ffmpeg command script to do what I want
using that discussion...

TIA

-- 
Bo Berglund
Developer in Sweden



More information about the ffmpeg-user mailing list