lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
540 stars 24 forks source link

7.1 audio getting converted to 5.0 rather than 5.1 #172

Closed zcutlip closed 1 year ago

zcutlip commented 1 year ago

I have a few recent rips from MakeMKV where the audio is getting converted to a 5.0(side) layout rather than a 5.1(side) layout.

I believe this is the first time I've encountered this. I'm sure the problem is on my end, probably something to do with how I ripped the disc, but I can't figure out what it would be.

I'm getting this in the ffmpeg log:

[auto_aresample_0 @ 0x7fc3af70d940] ch:8 chl:7.1 fmt:s32 r:48000Hz -> ch:5 chl:5.0(side) fmt:fltp r:48000Hz

Here's what it the log has to say about the input stream:

Stream #0:1(eng): Audio: flac, 48000 Hz, 7.1, s32 (24 bit) (default)
    Metadata:
      title           : Surround 7.1
      BPS-eng         : 2738422
      DURATION-eng    : 02:16:20.640000000
      NUMBER_OF_FRAMES-eng: 85215
      NUMBER_OF_BYTES-eng: 2800255857
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.2 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-11-30 14:18:59
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID

In case it matters, this is happening with a recently purchased Matrix box set. It seems to be happening both versions (HD & UHD) of each of the first three films. I already had the 4th film ripped, so I don't know if it would have been affected or not.

I've attached the ffmpeg log generated by other-transcode.

The Matrix (1999) - 1080p.mkv.log

loshlee commented 1 year ago

Does that happen if you try --mp4?

zcutlip commented 1 year ago

gave it a try just now, and yes it seems to

I still get the following, when using --mp4:

[auto_aresample_0 @ 0x7fa9a400dc80] ch:8 chl:7.1 fmt:s32 r:48000Hz -> ch:5 chl:5.0(side) fmt:fltp r:48000Hz
loshlee commented 1 year ago

I don't have that Blu-ray, but is there a digital copy or something else on it that might offer a different audio track that you could target using MakeMKV? If I remember correctly, MakeMKV doesn't allow older versions to work, so my first idea is to determine whether the issue is isolated to ffmpeg or whether MakeMKV could be involved. I'm using a Mac, so it's fairly trivial to use version 4 instead of 5 of ffmpeg. Could you also try that?

zcutlip commented 1 year ago

I'll have a closer look at the discs to see if there was an audio track I missed somehow.

If I remember correctly, MakeMKV doesn't allow older versions to work

Can you elaborate on this? Are you saying older versions of ffmpeg are incompatible with MakeMKV's output?

I'm currently using ffmpeg 5.1.2

lisamelton commented 1 year ago

@zcutlip I think you're seeing a bug that I fixed in the latest version of the other_video_transcoding Gem.

What version of other-transcode are you using?

loshlee commented 1 year ago

MakeMKV generally disables the license key for any version other than current. I was suggesting using the ffmpeg command included in your log with ffmpeg 4 rather than ffmpeg 5. Both are available, I think. but Don has taken this on, so no more worries. :)

zcutlip commented 1 year ago

@donmelton that appears to have done the trick. I was on 0.11 and upgrading to 0.12 get's me the following expected output in the log (I haven't tried a full transcode):

[auto_aresample_0 @ 0x7fb43201bf40] ch:8 chl:7.1 fmt:s32 r:48000Hz -> ch:6 chl:5.1(side) fmt:fltp r:48000Hz

Thanks!

lisamelton commented 1 year ago

@zcutlip You are very welcome! I'm glad that was the issue.

I will close this out now.

zcutlip commented 1 year ago

for anyone who comes along later, re-encoding these with the corrected channel layout also fixed an issue where Plex + Apple TV down mixing for headphones caused most of the dialogue to come through the right channel 🎉

lisamelton commented 1 year ago

@zcutlip Good to know and thank for the update! 👍