Ever needed to convert a video clip (MKV, MP4, etc) to a transport stream file? Here's how:
ffmpeg -i INPUT.mkv -c:v libx264 -c:a aac -ar 48k -b:a 192k -pix_fmt yuv420p -streamid 0:100 -streamid 1:101 -mpegts_flags latm OUTPUT.ts
You will need to modify the command above to meet your needs - the PIDs to use along with codecs, bitrates etc. Below explains what each flag is for:
-c:v libx264specifies the video codec as x264-c:a aacspecifies the audio codec as AAC-ar 48ksets the audio samle rate-b:a 192ksets the audio bitrate-pix_fmt yuv420psets the pixel format-streamid 0:100tells ffmpeg to set the PID of the first stream (video/image in this case, because it was specified first) to 100-streamid 1:101tells ffmpeg to set the PID fo the second stream (audio) to 101-mpegtf_flags latmtells ffmpeg to use LATM packetisation for AAC streams