I am trying to convert couple of rather large MXF files into TS files preserving the video and audio encoding. The output TS has to be CBR Mpeg-2 TS file, which I know is not possible with ffmpeg. Any idea for another preferably Linux command line tool which could handle this task? Windows is also an option, but I want to convert couple of files on a server, so that is why it would be better if it is Linux based.
Okay thanks to @Mulvya I have found a solution how I can create CBR MPEG-2 TS with stuffing and constant constant bitrate and inside of it VBR VPID. The command for H.264 is:
$ ffmpeg -i <input> \ -c:v libx264 -x264opts nal-hrd=cbr \ -b:v 30M -minrate:v 30M -maxrate:v 30M -muxrate 35M -bufsize:v 25M \ -c:a aac -ac 2 -b:a 128k \ -f mpegts <output.ts>
This will create 35Mbps CBR TS and inside the TS the bitrate of the VPID will fluctuate a bit around 30Mbps, and also the bitrate of PID 8191 (null PIDs).
The command for doing the same but with HEVC is the following:
ffmpeg -i <input> \ -c:v libx265 -b:v 25M -muxrate 30M \ -x265-params strict-cbr=1:vbv-bufsize=25000:vbv-maxrate=25000 \ -c:a aac -ac 2 -b:a 128k \ -f mpegts <output.ts>
Here the TS will be with 30Mbps bitrate and the VPID will be around 25Mbps, this command will create also stuffing (null PIDs) around 5Mbps.
Please also note that the bitrate after
-x265-params should be in Kbps.