Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcode multichannel audio to keep multichannel support #2003

Draft
wants to merge 2 commits into
base: 2.2.z
Choose a base branch
from

Conversation

cewert
Copy link
Member

@cewert cewert commented Oct 20, 2024

If the device supports multichannel audio and the selected audio stream has more than 2 channels, tell the server we want ac3 (or dts) instead of the usual aac for stereo speakers.

Issues

Remake of #1466
Fixes #1979

@cewert cewert added the bug-fix This fixes a bug. label Oct 20, 2024
@cewert cewert linked an issue Oct 20, 2024 that may be closed by this pull request
@cewert cewert marked this pull request as ready for review October 20, 2024 22:45
@cewert cewert requested a review from a team as a code owner October 20, 2024 22:45
@cewert cewert force-pushed the transcode-multichannel-audio branch from 9a4ac22 to c0f0a18 Compare October 20, 2024 23:10
@cewert cewert changed the title Transcode audio to keep multichannel support Transcode multichannel audio to keep multichannel support Oct 21, 2024
@dathbe
Copy link

dathbe commented Oct 21, 2024

Posted a testing comment here #1979 (comment)

@cewert
Copy link
Member Author

cewert commented Oct 21, 2024

@dathbe thanks for testing. Can you post the file info? Either ffprobe or the media info from the web client. Does it create a transcode log for the server? If so can you post that too

@dathbe
Copy link

dathbe commented Oct 21, 2024

I tried three files. One I had created for testing purposes with 5.1 AAC, and the other two were just standard files already on my HDD. Here are the stats for the new file.

ffprobe version 4.3.8-0+deb11u1 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'aac_5.1.mkv':
  Metadata:
    creation_time   : 2024-10-21T19:34:54.000000Z
    ENCODER         : Lavf60.16.100
  Duration: 00:06:40.02, start: -0.021000, bitrate: 938 kb/s
    Chapter #0:0: start 8.782000, end 353.919000
    Metadata:
      title           : Chapter 2
    Chapter #0:1: start 353.919000, end 399.965000
    Metadata:
      title           : Chapter 3
    Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1280x542 [SAR 1:1 DAR 640:271], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      DURATION        : 00:06:40.007000000
    Stream #0:1(eng): Audio: aac (LC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Surround 5.1
      DURATION        : 00:06:40.021000000

I do not see any transcode logs. The existing files on my HDD should have direct played without any transcoding.

Also, flagging that @closesim tested and replied here: #1979 (comment)
Same results.

I'll also add that I tested both the new and existing files in the production version of the app, and they all played fine (with the expected downmixing of AAC 5.1 to 2.0).

@cewert cewert marked this pull request as draft October 22, 2024 00:27
@jellyfin-bot jellyfin-bot added the merge-conflict This PR has a merge conflict label Nov 19, 2024
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be reviewed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This fixes a bug. merge-conflict This PR has a merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force AAC 5.1 to AC3 5.1
3 participants