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

Roger rogerx.oss at gmail.com
Thu May 19 20:56:00 EEST 2022


Just a quick follow-up on this, seems I found another similar post sometime ago 
on this list, searching the archives.

The "[FFmpeg-user] Re-encode mpeg2 for same quality" 2015 archived response was:

"Use -qscale 2 -mbd 2 (or qscale 1)."


$ ffmpeg -i input.ts -filter:v yadif=1 -qscale 2 -mbd 2 -acodec copy out.mts

The incantation resulted with 2-3x's larger file size of the original transport 
stream. (eg. *.ts)

However the quality significantly improved, other than just using the "-b:v 
6500k" incantation, especially noticeable when viewing the high velocity human 
movements/exercises.

Shrugs.  I may still perform some test using the "-bufsize" option.

Any feedback would be great to hear on this.  The media is private VHS recorded 
events, captured using S-Video cable and a Hauppauge capture card.


Roger


> On Tue, May 17, 2022 at 10:04:06PM -0400, Roger wrote:
>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
>https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
>
>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?
>
>Roger


More information about the ffmpeg-user mailing list