How to compress 4k HD video to mp4 using hevc and h265 codec and fdk_aac.

Started by rupeshforu3, March 04, 2021, 11:49:24 AM

Previous topic - Next topic

rupeshforu3

Hi I am Rupesh from India and I have PC and a DVD drive. From others I have bought a DVD which consists of video but the quality is too high and so size also. I want to compress them to mp4.

I have brought three DVDs from my friend and these consists of upto 30 .vob files and the total files size is upto 32 GB.

I have opened the properties of one file and it is showing that video bitrate is 5500 kbps and audio bitrate is 320 kbps and video resolution is 2400 by 2000 etc.,.

Now I want to convert these vob files to mp4 using hevc and h265 video codec and fdk_aac audio codec.

I have tried to convert these vob files using handbrake and avidemux in both Windows and Linux operating systems.

To convert one file it is taking time upto two hours.

Someone suggested that we must have separate hardware hevc pci card to encode any video to mp4 but my PC is old I mean it has amd radeon 3000 HD graphics.

Can any one of you suggest how to convert these vob files to mp4 with 1024 by 768 resolution and at 1100 video bitrate and 96 kbps audio bitrate.

Regards,
Rupesh.

butterw

encoding hevc on cpu is going to be slow, it may be preferable to use x264-high (maybe with --slow option) and increase bitrate a bit. The best way to determine this is to do a short test-encode.

To hit a video target bitrate, a two-pass encode is required. 
You probably should be using 128kbps AAC for stereo audio.

eumagga0x2a

Quote from: rupeshforu3 on March 04, 2021, 11:49:24 AMI have opened the properties of one file and it is showing that video bitrate is 5500 kbps and audio bitrate is 320 kbps and video resolution is 2400 by 2000

Really? This is not a valid resolution for video DVD.

Quote from: rupeshforu3 on March 04, 2021, 11:49:24 AMNow I want to convert these vob files to mp4 using hevc and h265 video codec and fdk_aac audio codec.

Don't choose a video codec which you cannot decode in hardware on your target device. HEVC is extremely expensive to decode, computation-wise. HEVC is supported by AMD graphics card from UVD (unified video decoder) level 6 on. The Radeon HD 3000 generation is level 1.

Therefore I can only second the recommendation given you by butterw.

An important question not covered by information you provided is whether the source video is interlaced. If it is, you should (no, absolutely must) insert a deinterlacer as the first video filter prior to any other modifications like scaling.

rupeshforu3

OK thanks for your suggestion and you have clarified that one must have newer graphics card on PC to use hevc.

Someone said that there is no need of proper graphics card or sound card to convert or compress from one file format to other. All the conversion or compression is done by processor but not by graphics card or sound card. Is it true.

The video resolution and bitrates I provided are approximate.

May I know about h265. Is there quality any difference between encoding using h265 codec, amd radeon HD 3000 and encoding level 6 graphics card.

eumagga0x2a

Quote from: rupeshforu3 on March 05, 2021, 05:50:23 AMSomeone said that there is no need of proper graphics card or sound card to convert or compress from one file format to other.

If the speed and energy consumption is not an issue, the graphics card doesn't matter.

Quote from: rupeshforu3 on March 05, 2021, 05:50:23 AMIs there quality any difference between encoding using h265 codec, amd radeon HD 3000 and encoding level 6 graphics card.

Radeon HD 3000 generation doesn't encode into HEVC at all, so no comparison possible. If you mean x265 (a popular software encoder for HEVC), then it is superios quality-wise to any hardware solution, of course. The purpose of a HW encoder is speed and low energy consumption.

For HEVC decoding, using a hardware decoder is mostly beneficial for performance and always beneficial for energy consumption, but with Avidemux, it can reduce performance in comparison to very powerful CPUs in some circumstances because software decoders in Avidemux can use multi-threading for decoding, not available with HW decoders.

rupeshforu3

Actually I am not decoding mp4 and compressing but I am decoding a vob file and encoding it to mp4 format.

According to you one must need a newer graphics card if he wants to decode mp4 and compress or convert it to another format.

eumagga0x2a

A video decoder decodes compressed video data, a container like mp4 and VOB is just a "box" for video, audio and other types of data streams. E.g. VOB is a container for MPEG-2 (mpeg2video) and compatible audio (pcm, mp2 or ac3) only. MP4 is a container which is compatible with a large variety of video codecs, including H.264, HEVC, AV1, MPEG-4 (DivX, Xvid) and even the old MPEG-2.

If you encode to HEVC and store the result in a mp4 container, you probably want the output to be playable with as low energy consumption as possible. You always can decode HEVC purely in software, it just costs a lot of energy (high CPU load).

A HW accelerated decoder in a graphics card has nothing to do with containers, it gets just the video stream.

rupeshforu3


Hi I am providing attachment which consists of the properties extracted from media info tool
 

eumagga0x2a

Thanks, mediainfo reports a usual standard-definition PAL source (anamorphic MPEG-2 720x576 with wide aspect ratio at 25 fps) with 6-channel AC3 audio.

If you need to re-encode it (e.g. to be able to use hardware-accelerated decoding when watching the video on a smartphone), you should first of all visually clarify for yourself whether the source is interlaced – in this case you should ( = absolutely must) insert a deinterlacer as the first video filter.

The second question to answer is whether to keep the result anamorphic and specify 16:9 aspect ratio in the configuration of the MP4 muxer or to scale to square pixels ( = quality loss and larger output file). Most video players respect aspect ratio info in the container, but if you know for sure that some device you use doesn't support it, you have to resize the video 720x576 --> 1024x576 (not 1024x765!).

Regarding audio, downsample it to stereo else the quality at 96 kbit/s will be horrible.

rupeshforu3

I can't decide whether the source file is interlaced or not. May I know how to decide whether the source file is interlaced or not.

At present I am using latest smartphone and latest version player and in future also I am going to use latest smartphone and latest version player.

At present my requirement is to encode source file with same video resolution but video bitrate at 1200 kbps. Coming to audio I want to use fdk aac with 96 kbps and 2 channels I mean stereo.

My question is is there is any difference in the quality of output file when the source file is encoded in old PC and when the source file is encoded in new PC. If you say that it will take more time while encoding in old PC then its not at all an issue.

Which is the best tool or software to accomplish this task.

eumagga0x2a

Quote from: rupeshforu3 on March 10, 2021, 12:30:03 PMMay I know how to decide whether the source file is interlaced or not.

If an object moves (if it is not just a vertical column moving strictly up or down), its outline looks comb-like if the video is interlaced and no deinterlacer is active: https://en.wikipedia.org/wiki/Interlaced_video

Quote from: rupeshforu3 on March 10, 2021, 12:30:03 PMAt present I am using latest smartphone and latest version player and in future also I am going to use latest smartphone and latest version player.

Strictly speaking, this doesn't provide any information about the subject, but it is more likely that such a device supports hw accelerated HEVC decoding as well as MP4 metadata necessary to specify display aspect ratio.

Quote from: rupeshforu3 on March 10, 2021, 12:30:03 PMMy question is is there is any difference in the quality of output file when the source file is encoded in old PC and when the source file is encoded in new PC.

If you use the same software encoder (x265 for HEVC, x264 for H.264) on both, the age of the PC doesn't matter for the properties and quality of output in every respect.

If you use a HW accelerated encoder, the properties and quality of the output is determined by the graphics card and the encoder settings.