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.ts

Parameter Breakdown

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.ts

Verifying 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.ts

The output should display the configured values:

TAG:service_name=My Channel
TAG:service_provider=My Network