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

Carlos E. R. robin.listas at telefonica.net
Mon Sep 30 09:51:38 EEST 2024


On 2024-09-29 21:59, Bo Berglund wrote:
> 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.

Perhaps something of this kind:

wget url | tee file.ts | ffmpeg whatever

Of course, you have to figure out the options to make wget write the 
file to stdout, and ffmpeg take the input from stdin. If that is not 
possible, I would try named pipes.

-- 
Cheers / Saludos,

		Carlos E. R.
		(from 15.5 x86_64 at Telcontar)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20240930/db944154/attachment.sig>


More information about the ffmpeg-user mailing list