ffmpeg encoding mpegts
is there anybody who can help me with video encoding? I want to encode video to MPEG-TS with null packet (PID 0x1fff). Anybody know how to do this? Is it possible?
My current command:
ffmpeg -i audio.mp2 -i video.mpg -s 720x576 -minrate 3200k -maxrate 3200k -bufsize 3200k -vcodec libx264 -vpre libx264-iptv -acodec copy -r 25 -f mpegts out.mpg
What do you mean by MPEG-TS? Do you mean that you want the file in a format acceptable for a DVD or do you mean an mpeg transport stream? If the latter, here is the documentation from the ffmpeg manual:
MPEG transport stream muxer.
This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
The muxer options are:
Set the original_network_id (default 0x0001). This is unique identifier of a network in DVB. Its main use is in the unique identification of a service through the path Original_Network_ID, Transport_Stream_ID.
Set the transport_stream_id (default 0x0001). This identifies a transponder in DVB.
Set the service_id (default 0x0001) also known as program in DVB.
Set the first PID for PMT (default 0x1000, max 0x1f00).
Set the first PID for data packets (default 0x0100, max 0x0f00).
The recognized metadata settings in mpegts muxer are service_provider and service_name. If they are not set the default for service_provider is "FFmpeg" and the default for service_name is "Service01".
ffmpeg -i file.mpg -acodec copy -vcodec copy \
-mpegts_original_network_id 0x1122 \
-mpegts_transport_stream_id 0x3344 \
-mpegts_service_id 0x5566 \
-mpegts_pmt_start_pid 0x1500 \
-mpegts_start_pid 0x150 \
-metadata service_provider="Some provider" \
-metadata service_name="Some Channel" \
Thank you for reply. Now I have another problem. I want to mux two files: video.h264 (720x576, 25fps, 2.5Mbps CBR) and audio.mp2 (192kbps, 48kHZ) to MPEGTS 3.2Mbps CBR.
Mediainfo information from out.ts file muxed with tsMuxeR:
Overall bit rate : 3 200 Kbps
Maximum Overall bit rate : 35.5 Mbps
I need to mux it with CBR. Second thing is NIT table. I want to set only PAT and PMT nothing else.
Well, that's beyond what I do with ffmpeg - I wouldn't consider myself an ffmpeg "expert", more an enlightened novice! :-)
Anyway, go to the ffmpeg web site to access the full documentation or user forums for more help with this: FFmpeg