[FFmpeg-user] MPEG2 Consistent/Same Bit Rate When Deinterlacing

Roger rogerx.oss at gmail.com
Wed May 18 05:04:06 EEST 2022

I'm processing an original (interlaced) Hauppauge Transport Stream (eg. MPEG2) 
video through the FFMpeg yadif deinterlace filter.  I would like to keep the 
same original bitrate, preserving quality.  I've read the following, but only 
seem to have success using "-maxrate 8500000 -b:v 6284k".

Limiting the output bitrate

ffprobe of original Hauppauge Transport Stream:
Input #0, mpegts, from 'input.ts':
  Duration: 00:14:40.51, start: 713.397322, bitrate: 6284 kb/s  <- bitrate
  Program 1 
  Stream #0:0[0x3e9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 8500000/0/0 buffer size: 1835008 vbv_delay: N/A  <- maxrate
  Stream #0:1[0x3ea]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s

My best effort so far seems to be the following incanatation:

$ ffmpeg -i input.ts -filter:v yadif=1 -maxrate 8500000 -b:v 6284k -acodec copy out.mts

660M input.ts
726M output.mts

This seems correct to me, expecting the deinterlaced file to be about 1/8-1/4 
file size larger than the original interlaced file size"

As far as using "-crf", this always seemed to provide a highly compressed MPEG2 
file, very unlike my experience with other video codec files.  Using "-bufsize" 
with the value from ffprobe input.ts also resulted with a highly compressed 
MPEG2 file.  And to reiterate, specifying the maxrate and bitrate from ffprobe 
input.ts so far seems to provide an almost identical quality of the original 
MPEG2 transport stream.  Can I do better?

As far as naming the output interlaced and deinterlaced files, is there a 
naming standard specified for the deinterlaced video file?  eg.  
file_name-int.mts and file_name-deint.mts?


More information about the ffmpeg-user mailing list