Reputation: 35
I am trying to segment the same stream of data into two file formats(mp4 and ts) using ffmpeg.Dump to one file format each time works just fine:
ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 -f segment -segment_time 240 "outf-%3d.ts"
and
ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 -f segment -segment_time 240 segment_format mp4 "outf-%3d.mp4"
How can I dump the segmented stream to outf.ts and outf.mp4 at the same time(In the same ffmpeg command)?
Upvotes: 1
Views: 1015
Reputation: 93369
If you want to keep the default encoder selection - mpeg2video and mp2 for TS and H264 and AAC for MP4, use
ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 \
-f segment -segment_time 240 "outf-%3d.ts" \
-f segment -segment_time 240 "outf-%3d.mp4"
If you want to encode only once, use
ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 \
-map 0:v? -map 0:a? -c:v libx264 -c:a aac
-f tee \
"[f=segment:segment_time=240]outf-%3d.ts| \
[f=segment:segment_time=240]outf-%3d.mp4"
Upvotes: 2