mpegtsmux: Support metadata in PES packets streams in TS
Fixes #3485 (closed)
Adds support for PES metadata streams in Transport Stream mpegtsmux
element.
- Added
meta/x-id3, parsed=true
caps template tompegtsmux
to mux ID3 metadata buffers into the TS stream. - Program and elementary stream descriptors are added to the Program Specific Information according to Apple metadata in HLS spec for ID3.
- A
metadata_pointer_descriptor
at program level - A
metadata_descriptor
withmetadata_format_identifier = 0x49443320 ("ID3 ")
metadata_application_format_identifier = 0x49443320
in the Elementary Stream - A
registration_descriptor
withformat_identifier = 0x49443320 ("ID3 ")
.
- A
Running a gst-launch pipeline like
videotestsrc is-live=true ! tee name=video_raw_tee
metadatasrc is-live=true ! meta/x-id3, parsed=true ! tee name=metadatatee ! queue ! fakesink
video_raw_tee. ! queue name=video_play_raw_queue ! videoconvert ! autovideosink
video_raw_tee. ! queue ! videoconvert ! x264enc bitrate=2000 byte-stream=true key-int-max=25 bframes=0 aud=true tune=zerolatency ! video/x-h264,profile=baseline,stream-format=byte-stream ! tee name="video_transcoded_enc_tee"
video_transcoded_enc_tee. ! queue name="video_transcoded_queue_mpegts" ! mpegtsmux name="mpegts_mux" ! tee name="mpegts_mux_transcoded_tee"
metadatatee. ! queue ! mpegts_mux.
mpegts_mux_transcoded_tee. ! queue ! filesink location=out.ts
where the metadatasrc
produces text buffers live (25Hz), creates a Transport Stream file out.ts
that looks like:
PSI/PMT
PMT descriptors
- (1)
metadata_pointer_descriptor
inprogram_info
- (2) Elementary Stream as Metadata carried in PES packets.
- (3)
metadata_descriptor
attached to Elementary Stream, withmetadata_application_format_identifier
andmetadata_format_identifier
set to0x49443320
(ID3
) - (4)
registration_descriptor
attached to Elementary Stream, withformat_identifier
set to0x49443320
(ID3
)
Edited by Juan Adarve