You are on page 1of 1

 

Video Production

FFMPEG - build transport stream with multiple programs


Asked
4 years, 1 month ago Modified
3 years, 11 months ago Viewed
3k times

I want to build a transport stream with multiple programs. To simplify the original post, I'm using three files that are the same video, but with different
watermarks to track them. (Went this way b/c Gyans request for full log makes this shorter)
2
ffmpeg -i KeanuRambo.ts -i KeanuLincoln.ts -i KeanuBush.ts \

-map 0:0 -map 0:1 -map 1:0 -map 1:1 -map 2:0 -map 2:1 \

-program program_num=1:title=Ram:s0:s1 -program program_num=2:title=Linc:s2:s3 \

-program program_num=3:title=Bush:s4:s5 \

-report -f mpegts out5.ts

The output file is zero bytes. Here is what the -report produced:

libswscale 4. 8.100 / 4. 8.100

libswresample 2. 9.100 / 2. 9.100

libpostproc 54. 7.100 / 54. 7.100

Splitting the commandline.

Reading option '-i' ... matched as input url with argument 'KeanuRambo.ts'.

Reading option '-i' ... matched as input url with argument 'KeanuLincoln.ts'.

Reading option '-i' ... matched as input url with argument 'KeanuBush.ts'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:0'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:1'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1:0'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1:1'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '2:0'.

Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '2:1'.

Reading option '-program' ... matched as option 'program' (add program with specified streams) with argument 'program_num=1:title=Ram:s0:s1'.

Reading option '-program' ... matched as option 'program' (add program with specified streams) with argument 'program_num=2:title=Linc:s2:s3'.

Reading option '-program' ... matched as option 'program' (add program with specified streams) with argument 'program_num=3:title=Bush:s4:s5'.

Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.

Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'.

Reading option 'out5.ts' ... matched as output url.

Finished splitting the commandline.

Parsing a group of options: global .

Applying option report (generate a report) with argument 1.

Successfully parsed a group of options.

Parsing a group of options: input url KeanuRambo.ts.

Successfully parsed a group of options.

Opening an input file: KeanuRambo.ts.

[NULL @ 0x7fc093801000] Opening 'KeanuRambo.ts' for reading

[file @ 0x7fc091d00de0] Setting default whitelist 'file,crypto'

[mpegts @ 0x7fc093801000] Format mpegts probed with size=2048 and score=50

[mpegts @ 0x7fc093801000] stream=0 stream_type=2 pid=100 prog_reg_desc=

[mpegts @ 0x7fc093801000] stream=1 stream_type=3 pid=101 prog_reg_desc=

[mpegts @ 0x7fc093801000] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:2

[mpegts @ 0x7fc093801000] max_analyze_duration 5000000 reached at 5000000 microseconds st:0

[mpegts @ 0x7fc093801000] After avformat_find_stream_info() pos: 0 bytes read:2576528 seeks:2 frames:346

Input #0, mpegts, from 'KeanuRambo.ts':

Duration: 00:03:26.31, start: 1.422422, bitrate: 2569 kb/s

Program 1

Metadata:

service name : Service01

ffmpeg

Share Improve this question Follow edited May 8, 2018 at 2:40 asked May 4, 2018 at 21:20
Kenny C
21 1 3

Share full log.


– Gyan
May 5, 2018 at 5:52

Content updated (log was 1.7MB) to just use same video and now the log is much cleaner.
–  Kenny C
May 8, 2018 at 2:41

1 Answer Sorted by: Highest score (default)

This should work.

3 ffmpeg -i KeanuRambo.ts -i KeanuLincoln.ts -i KeanuBush.ts \

-map 0:0 -map 0:1 -map 1:0 -map 1:1 -map 2:0 -map 2:1 \

-program program_num=1:title=Ram:st=0:st=1 -program program_num=2:title=Linc:st=2:st=3 \

-program program_num=3:title=Bush:st=4:st=5 \

-f mpegts out5.ts

Share Improve this answer Follow answered May 8, 2018 at 7:20


Gyan
30.2k 2 51 86

You might also like