this post was submitted on 24 Sep 2023
19 points (95.2% liked)

Piracy

22376 readers
4 users here now

Welcome to /c/piracy

No netflix or streaming services landlubbers allowed, this is pirates territory.

founded 5 years ago
MODERATORS
 

Hi all,

I have been re-encoding using handbrake’s presets (Matroska hevc 480p/1080p) and results are good for the most part, some issues here and there. I started trying out ffmpeg with cuda and hevc_nvenc and p7 preset. Video quality looks way better but audio is very bad. I am using aac 128k and the audio is very compressed and quite frankly hurts my ears. I started looking into the handbrake options and there’s auto pass through and stereo downmixing, etc. I tried reading the ffmpeg documentation but there is a lot there and I’m not really sure what I’m doing.

tldr; Anyone have tips on getting good quality audio encoding (aac) from my bluray rips?

top 10 comments
sorted by: hot top controversial new old
[–] vzq@lemmy.blahaj.zone 26 points 1 year ago (1 children)

I am 90% sure handbrake is an ffmpeg front end. If you dig around in the config files or source repo you can probably find the exact settings used.

[–] notfromhere@lemmy.one 0 points 1 year ago

My understanding is that handbrake uses some of the ffmepg libraries but is not on top of the ffmpeg binary, so things do that translate directly. I’ll check out the source code and see what I can figure out about the preset to ffmpeg option mapping.

[–] Nawor3565@lemmy.blahaj.zone 12 points 1 year ago (1 children)

Handbreak is just a GUI for FFmpeg, so the only thing it could be is your settings. Are you using the -c:a copy option with FFmpeg to copy the audio instead of transcoding it?

[–] notfromhere@lemmy.one 0 points 1 year ago

I’ll give copy a try instead of transcoding and see how that works. I wanted the video, audio, and container format to be the same across my library, so as long as it’s always using the same codec across my movies, that should be fine.

[–] bbbhltz@beehaw.org 4 points 1 year ago (1 children)

Some things to look at:

Is it possible that Handbrake is just copying the audio from the source, and ffmpeg is transcoding it? I make podcast videos for my partner and I have run into problems with audio quality, so I think I have heard what you're talking about.

Also, what are you running this on? It is possible that the Ffmpeg on your system was not compiled with all the options you need.

[–] notfromhere@lemmy.one 2 points 1 year ago

Running on Ubuntu LTS. I will try out copying the audio and comparing. I have a huge backlog and already made a good dent before I caught this problem.

[–] sqw@lemmy.sdf.org 3 points 1 year ago (1 children)

yes basically handbrake is an easy button but not as powerful as ffmpeg. ffmpeg has aac encoding options, sometimes you can get into easier syntaxes just to make it easier on the mortal mind by first demuxing your source file into individual streams, re-encoding those as needed, then remuxing together. i still have no idea how to get ffmpeg to use cuda/nvenc and also do other things as the syntax becomes arcane to me

[–] notfromhere@lemmy.one 2 points 1 year ago

Yea easy button means I’m not learning much about the process. I think I just need to take the plunge and learn all about ffmpeg.

[–] Cyberflunk@lemmy.world 1 points 1 year ago

It's live to know how rarbg did this x265 rips

[–] qfjp@lemmy.one 1 points 1 year ago

It's hard to know for sure, but I'm guessing if you're forcing hevc_nvenc in ffmpeg then handbrake is using libx265. Nvidia's encoder rips through files, but that speed comes at the cost of bigger file sizes. libx265 uses the cpu so it'll be much slower, but you'll probably see files 30% smaller. As for audio, you could always try -c:a copy as an option for ffmpeg. I don't actually use handbrake myself, so I don't know how to directly copy streams.

As a side note, if you don't need to worry about licensing issues mp4 will compress much better than mkv.