Avidemux Forum

Avidemux => Windows => Topic started by: aviphil87 on April 13, 2015, 02:55:27 PM

Title: Same episode SD or HD, same output codec, output size triples
Post by: aviphil87 on April 13, 2015, 02:55:27 PM
Dear all,

I record episodes on TNT (digital air TV), typically 40 minutes or so each, and then convert them to .mp4 in Avidemux (2.6.8.9052-64 but got same results with 32-bit versions).

I use the following options:
   - Video output :  Mpeg4 AVC (x264), resize 1280x720,
   - Audio output :  AAC (Faac) 1 track
   - Output format : MP4 Muxer

I get the following results:
   - with an input file MPEG2 720x576, enlarged to 1280x720 the resulting .mp4 sizes between 250 and 300 Mb,
   - with an input file HD 1920x1080, downsized to 1280x720 the resulting .mp4 is every time threefold larger.

And so, a given episode, was it recorded from SD or HD, and then processed with the same codec, and with the same output format, contains exactly the same story but in a size ratio of one to three:
   a) as the same codec is required to generate the same output format, why such a huge size difference?
   b) is there any parameters/options I may set, so that an HD file processed to 1280x720, is forced within the reasonable limits of 250 to 300 Mb?

Thank you,
Title: Re: Same episode SD or HD, same output codec, output size triples
Post by: Jan Gruuthuse on April 13, 2015, 06:10:48 PM
Far more information in 1920x1080 clip (scaling down).
Far less information in 720x576 clip (scaling up).
There is no golden rule or exact science.
Mark a one minute section in the 1920x1080 clip and use different Rate Control Quality's/bitrates.
In Video Output: [Configure]
Constant Rate Factor (Single Pass):
1 minute q20 would give 18.5 MB
1 minute q22 would give 13.7 MB
1 minute q24 would give 10.3 MB
1 minute q26 would give 08.0 MB
1 minute q28 would give 06.4 MB

Average Bitrate (2 Pass)
1 minute @ 2310 kbit/s : 18.6 MB
1 minute @  1670 kbit/s : 13.7 MB
1 minute @  1230 kbit/s : 10.3 MB
1 minute @  0930 kbit/s : 08.1 MB
1 minute @  0930 kbit/s : 06.4 MB

See what works for you.
Find attached 10 samples derived from hdtv 1920x1080 9602 Kbps 7zipped, dropbox download 107 MB
Just close the sign in pop-up window, you should get to the download.




Title: Re: Same episode SD or HD, same output codec, output size triples
Post by: poutnik on April 14, 2015, 10:14:10 AM
Quote from: aviphil87 on April 13, 2015, 02:55:27 PM

I get the following results:
   - with an input file MPEG2 720x576, enlarged to 1280x720 the resulting .mp4 sizes between 250 and 300 Mb,
   - with an input file HD 1920x1080, downsized to 1280x720 the resulting .mp4 is every time threefold larger.


Try to think harder what is the difference between these 2 1280x720 encodings.
Are they of the same visual quality ?  No, they are not.

The latter is sharper and with more details.
This comes with price of lower video compressibility.

Generally, unless you are really restricted by target size (like CD), or streaming bandwidth of online content,
the most reasonable and recommended way of X264 encoding is constant quality(Constant Rate Factor ),
that provides variable size, depending on video content.

Once you determine the CRF value providing small enough files and still with quality you consider good,
you can apply it on all future encodings for given user/target device scenario.

Title: Same episode SD or HD, same output codec, output size triples
Post by: aviphil87 on April 14, 2015, 03:07:46 PM
Thank you very much for the info and for the samples.

Anybody that, like me, played with 8 mm movies for years, we know that "details" and "sharpness" is a somewhat subjective notion. In fact, a moving picture always looks sharper than when looking at the same individual movie frames with a magnifier. Add to this than when being well into the action, sharpness is usually not the most important.

In short I shall experiment with CRF and see how it fits.

Thanks again for your time,
Title: Re: Same episode SD or HD, same output codec, output size triples
Post by: poutnik on April 15, 2015, 12:15:49 PM

Details and sharpness can be objectively quantified by shape of data, densities of local maxima and minima and by steepness of transitions.

Near all subjective matter related to human vision are already "abused" by lossy video compression algorithms, since MPEG2 till H265.
Where eyes are cheat-able not noticing bad data, they are cheated, in favour of quality of those parts where cheating is not so easy.

Movies are in average per picture much more compressed than still pictures.
Title: Re: Same episode SD or HD, same output codec, output size triples
Post by: poutnik on April 15, 2015, 01:24:53 PM
Quote from: aviphil87 on April 13, 2015, 02:55:27 PM

I get the following results:
   - with an input file MPEG2 720x576, enlarged to 1280x720 the resulting .mp4 sizes between 250 and 300 Mb,
   - with an input file HD 1920x1080, downsized to 1280x720 the resulting .mp4 is every time threefold larger.


Said by other words than last time,

Pixels in video  in original resolution or downsampled resolutions have limited correlation wrt values of neigbor pixels.

Therefore such video contains a lot of information, that get compressed to bigger size.

Pixels in video in upsampled resolutions ( SD2HD or SD2semiHD ) have high correlation of neigbor pixels values, as many of them are just interpolation between pixels.

Therefore such video contains less information, as pixel values are predictable from other pixels. This is well addressed by compression algorithms and video gets compressed to smaller size.
Title: Same episode SD or HD, same output codec, output size triples
Post by: aviphil87 on April 16, 2015, 01:54:33 PM
Default CRF value is 20.

I tried 34, output file is 130 Mb but image is too degraded.

I tried 27, output file is 300 Mb and to my eye the image shows no visible loss, so this value suits me perfectly.

Thank you again
Title: Re: Same episode SD or HD, same output codec, output size triples
Post by: poutnik on April 17, 2015, 06:19:31 AM
Quote from: aviphil87 on April 16, 2015, 01:54:33 PM
Default CRF value is 20.
I tried 34, output file is 130 Mb but image is too degraded.
I tried 27, output file is 300 Mb and to my eye the image shows no visible loss, so this value suits me perfectly.

Thank you again

Usual recommended CRF range is 19-26.
HD content can with stand higher ( lower quality ) values than SD content, which is eventually upsampled when played.

Optimal value depend on target user and target device.
E.g. you can afford higher values on small smartphone 848x480 screen, but would like lower values on HD 1920x1080 desktop monitor, or on wall HD TV of Home theatre.