Configure MPEG-TS Service and Provider Name in FFmpeg
This article explains how to customize the service name and service provider metadata within an MPEG-TS (MPEG Transport Stream) container using the FFmpeg command-line tool. You will learn the exact command-line flags required to modify these metadata fields, which are crucial for proper channel identification on digital television receivers, IPTV players, and hardware decoders.
To set the service name (the channel name) and the provider name (the
broadcaster or network name) in an MPEG-TS container, you must use the
-metadata option with the keys service_name
and service_provider.
The Basic Command
Here is the standard FFmpeg command to set these values while copying the video and audio streams without re-encoding:
ffmpeg -i input.mp4 -c copy -map 0 -f mpegts -metadata service_provider="My Network" -metadata service_name="My Channel" output.tsParameter Breakdown
-i input.mp4: Specifies the input file.-c copy: Copies the video and audio codecs directly without re-encoding, saving time and preserving original quality.-map 0: Ensures all streams (video, audio, subtitles) from the input file are mapped to the output file.-f mpegts: Forces the output format to be MPEG-TS.-metadata service_provider="My Network": Configures the SDT (Service Description Table) provider name metadata.-metadata service_name="My Channel": Configures the SDT service name (the channel name displayed to users).output.ts: The path to your output MPEG-TS file.
Setting Metadata During Re-encoding
If you need to transcode the video and audio while setting the
metadata, replace -c copy with your desired video and audio
encoders:
ffmpeg -i input.mp4 -c:v libx264 -b:v 5000k -c:a aac -b:a 192k -f mpegts -metadata service_provider="Cable Corp" -metadata service_name="HD News" output.tsVerifying the Metadata
After generating your MPEG-TS file, you can verify that the service
name and provider name were written correctly using
ffprobe:
ffprobe -show_entries format_tags=service_name,service_provider -of default=noprint_wrappers=1 output.tsThe output should display the configured values:
TAG:service_name=My Channel
TAG:service_provider=My Network