SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

aac (LC) 5.1 audio plays as stereo #3912

Closed helpappreciated closed 3 years ago

helpappreciated commented 4 years ago

Setup

_Package Name: ffmpeg _Package Version: 4.2.1-23

_Package Name: video station _Package Version: 2.4.6-1594

_NAS Model: DS218play _NAS Architecture: rtd1296 (armv8) _DSM version: 6.2.2-24922 Update 4

Expected behavior

Videos with aac (LC) 5.1 audio play back via Airplay through ATV3 as 5.1 audio.

Actual behavior

Videos with aac (LC) 5.1 audio play back via Airplay through ATV3 as stereo.

Steps to reproduce

_1. play a video file with aac (LC) 5.1 audio via Airplay on ATV3 _2. check if receiver plays 5.1 audio

Additional information

Videos with aac (HE-AAC) 5.1 audio play back correctly as 5.1 audio in the same setup.

I followed this manual for my model: https://gist.github.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e

I edited a line in VideoStation/etc/TransProfile to "mpegts_remux_lame_ab256_ac2": "-threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb=repeatheader -acodec ac3_fixed -f ssegment"

I didn't manage to get a log file

th0ma7 commented 4 years ago

Hi @helpappreciated (and adding @BenjaminPoncet) I suggest you reply to https://gist.github.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e#gistcomment-3192393 and see if you can get help from there.

My understanding is that videostation does transcoding on a per-streaming device basis. As such with Airplay this might be its default behaviour and not much can be done about it? But one thing is for sure, @BenjaminPoncet as much more knowledge on that than I do and probably in a way better position to help you out.

th0ma7 commented 4 years ago

As a side note, you can give a shot at upcoming beta packages of ffmpeg 4.2.2 at: https://github.com/th0ma7/synology/tree/master/packages Perhaps this may solve your issue?

helpappreciated commented 4 years ago

You have no idea how much respect I have for your work. Thank you for doing all this and thanks a lot for your input. I will post there. Clueless me thought there might be an option to just add a line of code somewhere and tell ffmpeg to convert all AAC audio in AC3 on the fly...

Strangely I found out that stereo files with aac (HE-AAC) audio stay silent on video station in browser. Aac (LC) audio plays normal in the same setup.

ymartin59 commented 4 years ago

@helpappreciated I have noticed that video may not play proper "in browser", whereas it is OK in "DS Video" player on iOS or Android, and it may be also different if DNLA is used to publish stream. So it may depend on installed codec on your operating system, if browser is able to handle it, if DSM pushes stream transcoded or as-is...

th0ma7 commented 3 years ago

Revisiting this issue. As we do not support VideoStation there is not much we can do on our end. Hopefully recent updates along with ffmpeg 4.3.2 and/or conjunction of newer VideoStation do work out for you.

Feel free to reopen if not related to Videostation which is supported entirely by Synology. Cheers!