HLS MPEG-TS metadata stream using FFMPEG
Asked Answered
T

1

8

I want to create mpeg ts segment for HLS streaming. The ts should contain metadata as a separate stream as shown below-

**Stream #0:0**[0x102]: Data: timed_id3 (ID3  / 0x20334449) 
**Stream #0:1**[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 426x240, 25 fps, 25 tbr, 90k tbn, 6k tbc
**Stream #0:2**[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 98 kb/s

I am using ffmpeg and have tried various option. I get the following ts structure-

**service_name**    : Service01
**service_provider**: FFmpeg
**Stream #0:0[0x100]**: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 1:1 DAR 5:4], max. 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
**Stream #0:1[0x101]**: Audio: mp2 ([3][0][0][0] / 0x0003), 16000 Hz, mono, s16p, 143 kb/s

using the following command-

ffmpeg -i news.ts -t 10 -metadata:s:v:0 TITLE="Some Provider" -id3v2_version 4 -write_id3v1 1 segid3.ts

How to get the metadata as a separate stream in the ts file using ffmpeg?

Toilet answered 20/1, 2015 at 10:57 Comment(0)
F
1

Try:

ffmpeg -i news.ts -t 10 -metadata:s:v:0 TITLE="Some Provider" -id3v2_version 4 -write_id3v1 1 -map 0:0 -map 0:1 -map 0:2 -c copy segid3.ts

Explanation: -map 0:0 -map 0:1 -map 0:2 will map the input stream 0:0, 0:1 and 0:2 to output stream 0:0, 0:1 and 0:2 respectively. -c copy will copy the input stream to output stream.

Farcy answered 29/9, 2022 at 19:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.