File gets bigger after reencoding, i don't understand why

Started by Isias, January 13, 2013, 09:58:05 AM

Previous topic - Next topic

Isias

I record TV shows broadcasted via Sky (PayTV) in HD (1080i broadcast, x264, about 10 MBit Stream) using Mediaportal 1.3 beta. I cut using Avidemux 2.6.0 x64 version on Windows 7 SP1 x64 build. If i use Avidemux to repack a file from .ts using audio & video set to copy and .mp4v2 as container, the video file is about 6,3 GB.

If i reencode the video to be able to set a frame exact start point (because of the key frames) with x264, CRF 18 and Pixel Aspect Ratio "As Input" (everything else concerning the codec is untouched), set audio to copy and the container to be mp4v2 the filesesize is about 7,6 GB. This also happens to all other recordings, for example tv shows. If i do just cut and don't reencode, the file gets about 1 GB in size, once i reencode, the file gets about 1,5 GB.


Is this a normal behaviour? Because this means i do get a quality and bitrate loss with a BIGGER filesize? Just setting it to copy results in a higher quality file while i only have the problem that at the beginning i have about 2 secs before the video starts and can't set a frame accurate ending time?

styrol

Quotex264, CRF 18 and Pixel Aspect Ratio "As Input"
Did you test with CRF=23 (much better compression because x264 CRF scale is logarithmic...)? CRF=22 (+/- 1) is a good value for HD content, but I never encode to x264 using Avidemux, so I have no real experience.

Jan Gruuthuse

#2
When using CRF 18 you should not notice any degradation. Please do check Menu -> Edit -> Preferences: [Video] -> Default Postprocessing and disable these:
[ ] Horizontal deblocking
[ ] Vertical deblocking
[ ] Deringing.
The smaller the Constant Rate Factor, the lesser compression is used, the bigger the file gets.

Isias

QuoteDid you test with CRF=23
I did, and the quality loss was noticeable. At CRF 18, i barely see any degradation compared to the source material. That's why i chose to use it. I actually only want to just cut the recordings so the film starts directly if possible with no reencoding at all. Since this is not possible with the copy mode because of the I frames, i chose to use CRF 18 to be able to reencode without (noticeable) quality loss.

QuoteDefault Postprocessing and disable
About horizontal / vert. deblocking, could this be the issue while a video being reencoded uses almost 500MB more than the same video not being reencoded (e.g., one "Friends" episode is 1 GB in "copy" mode, about 1,5 GB output after the reencode)?

I don't exactly understand what does postprocessing parameters do and what i might benefit from by disabling them?

/Edit: I just checked the menu and they're already disabled. Nothing is checked in post processing.

mean


Isias

It's a standard dvb-s2 digital broadcast transmitted in 1080i(nterlaced). I can't say it looks very noisy. So, it's normal that by reencoding a tv episode the file size gets bigger by about 50% when being reencoded compared to a stream copy? Great work on 2.6.0 btw., it makes things a lot easier compared to 2.5 when it comes to x264 HD tv recorded material.

Jan Gruuthuse

Quote from: Isias on January 13, 2013, 02:53:50 PMI don't exactly understand what does postprocessing parameters do and what i might benefit from by disabling them?
In some instances you get some degradation, using these.
QuoteVideo post-processing is the process of changing the perceived quality of a video on playback (done after the decoding process). Image scaling routines such as linear interpolation, bilinear interpolation, or cubic interpolation can for example be performed when increasing the size of images, this involves either subsampling (reducing or shrinking an image) or zooming (enlarging an image). This helps reduce or hide image artifacts and flaws in the original film material. It is important to understand that post-processing always involves a trade-off between speed, smoothness and sharpness.
source:Video post-processing
I never re-encode HD mpeg-TS. I select the cutting point as good as it gets. Use slider to select near cutting point. Now select cutting point only with keyboard up/down arrow, and mark [A ] or [ B] for begin or end of video.
Cut commercial blocks out. Go to start of block with slider. Again with up/down arrow only select point to start cut, mark [A ]. Go to end of block with slider. Again select cut point with up/down arrow, mark [ B]. Now cut that block with [Ctrl][X]. Got to next block repeat this procedure.

If I ever need to re-encode 1080i, I use CRF 20. Seems to be acceptable for me on 40'' samsung flatscreen. For 575i CRF 25 seems reasonable. Recordings here are made with 10 minute lead in/out from DVB-S2.

Keep in mind some channels are pseudo HD (upscaled from standard broadcast material) and these could cause issues (artefacts, ...) while re-encoding, my understanding of juggling pixels around. Upscaled SD TV to HD-TV and re-encoding this again. None of these techniques are using lossless compression.

Isias

Ok, thx. I think that some of the material is non-native HD material for sure. I'm considering to switching back to copy mode, even if this means that it won't be absolutly frame accurate, since it's only possible to cut on key frames (and i can't set them manually, i assume?). Thx for the explanation of the post-processing options. One last question maybe, if i can't use the crop filter because of video set to "copy", will this cause any problems? For example, if i watch the movie on a 50" tv screen or on a beamer, will the software add extra black borders to the existing ones?

To be more precisyl, i'm worried that if i can't crop the borders, the borders will get "doubled", in other words, if the tv "sees" the file has 1920x1080, will it still add extra black borders?

mean


Jan Gruuthuse

Quote from: Isias on January 13, 2013, 06:56:39 PM
To be more precisyl, i'm worried that if i can't crop the borders, the borders will get "doubled", in other words, if the tv "sees" the file has 1920x1080, will it still add extra black borders?
Sadly enough this depends on the implementation of used (internal) media player of the used device. Samsung flatscreens have for example issues showing the correct aspect ratio with some used media containers (mkv, ...)
Under normal conditions, you should see mpeg-ts files been played correctly, as transmitted,   if supported by the player.

I also uploaded some sample original mpeg-ts HD-tv recordings showing video quality and one showing upscaled video with a low video Kbps: HD recordings and their differences

Isias

Ok, i switched to copy mode, since my PS3 as well as my tv and my pc (of course) do recognize the black borders correctly and don't add new ones. Thx guys :- )