No audio with MP4 video files using mp4a at 48 kHz sample rate

*nix specific usage questions
DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 22 Jun 2020 10:25

Hello all,

just today, I encountered a few MP4 video files that would not play with audio on VLC on Linux.

VLC version:

Code: Select all

VLC media player 3.0.10 Vetinari (revision 3.0.10-0-g7f145afa84) VLC-Version 3.0.10 Vetinari (3.0.10-0-g7f145afa84)
Linux distribution used:

Code: Select all

DISTRIB_ID=ManjaroLinux DISTRIB_RELEASE=20.0.3 DISTRIB_CODENAME=Lysia DISTRIB_DESCRIPTION="Manjaro Linux"
Codec information:

Code: Select all

Codec: MPEG AAC Audio (mp4a) Language: English Type: Audio Channels: 3F2R/LFE Sample Rate: 48000 Hz Bits per Sample: 32
Strange enough, there is not a lot of information found on the net. As I have a few videos where the audio sample rate is set to 44100 Hz (all other parameters the same as in the example), which all play flawlessly, I guessed the sample rate was the problem.

Instead, the solution is to change the preferred decoder to avcodec (see here and here).

Question is: What advantages does faad have over avcodec that it is used as the default in VLC?

Thank you very much for all insights in advance and kind regards,

DAC324

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 29 Jun 2020 12:25

Update:

This behavior also occurs with the latest VLC version 3.0.11 on Linux.
It looks like FAAD2 is not able to decode this kind of files as 48 kHz sample rate seems to be out of spec for this decoder.

InTheWings kindly advised me to have a look at the possibility of libfaad.so being replaced.

Unfortunately, the latest version of libfaad for Linux appears to be 2.0.0, and there seems to have been no update since 2017, according to the source available for download at the Audiocoding site.

Does anybody know if a newer libfaad version exists for Linux?

Thank you very much and kind regards,
DAC324

Rémi Denis-Courmont
Developer
Developer
Posts: 15214
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby Rémi Denis-Courmont » 29 Jun 2020 13:08

VLC (on Windows or macOS) uses FAAD 2.9.2. This is also available on Debian...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 29 Jun 2020 15:18

VLC (on Windows or macOS) uses FAAD 2.9.2. This is also available on Debian...
Thank you very much for this information.
Indeed, I must admit that I am a little bit confused:

Code: Select all

$ pacman -Qs faad2 local/faad2 2.9.2-1 ISO AAC audio decoder

Code: Select all

$ ls -l /usr/lib/libfaad* lrwxrwxrwx 1 root root 20 5. Mai 11:58 /usr/lib/libfaad_drm.so -> libfaad_drm.so.2.0.0 lrwxrwxrwx 1 root root 20 5. Mai 11:58 /usr/lib/libfaad_drm.so.2 -> libfaad_drm.so.2.0.0 -rwxr-xr-x 1 root root 251800 5. Mai 11:58 /usr/lib/libfaad_drm.so.2.0.0 lrwxrwxrwx 1 root root 16 5. Mai 11:58 /usr/lib/libfaad.so -> libfaad.so.2.0.0 lrwxrwxrwx 1 root root 16 5. Mai 11:58 /usr/lib/libfaad.so.2 -> libfaad.so.2.0.0 -rwxr-xr-x 1 root root 264088 5. Mai 11:58 /usr/lib/libfaad.so.2.0.0
Looks like the package version available here is indeed 2.9.2-1 but it installs libfaad*.2.0.0 :?:

Also, I had a look in the FAAD2 source. In decoder.c, it says:

Code: Select all

hDecoder->config.defSampleRate = 44100; /* Default: 44.1kHz */
But on the other hand, 48 kHz appears to be a valid sample rate, anyway (common.c):

Code: Select all

/* Returns the sample rate based on the sample rate index */ uint32_t get_sample_rate(const uint8_t sr_index) { static const uint32_t sample_rates[] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000 };
Looks like there is a bug in FAAD2 (at least on Linux) preventing it to handle the 48 kHz sample rate properly.

Kind regards,
DAC324

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby InTheWings » 06 Jul 2020 10:14

Looks like the package version available here is indeed 2.9.2-1 but it installs libfaad*.2.0.0 :?:
2.0.0 is the API/ABI numbering, not library version
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 21 May 2021 15:36

Hello,

just to provide some update. Meanwhile, faad2 has been updated to package version 2.10.0-1 but the problem with the sample rate of 48 kHz not being processed properly, still persists.

Kind regards,
DAC324

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby InTheWings » 21 May 2021 16:00

Hello,

just to provide some update. Meanwhile, faad2 has been updated to package version 2.10.0-1 but the problem with the sample rate of 48 kHz not being processed properly, still persists.

Kind regards,
DAC324
Provide a way to reproduce the issue
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 25 May 2021 13:33

Provide a way to reproduce the issue
At first, you need a video file with the following specifications:

Code: Select all

Stream 0 Codec: H264 - MPEG-4 AVC (part10) (avc1) Type: Video Video Resolution: 1280 x 720 Buffer Size: 1280 x 720 Frame Rate: 23.976032 Decoded Format: <empty> Alignment: Upper left Basic Colors: ITU-R BT.709 Color transmission function: ITU-R BT.709 Color Space: ITU-R BT.709 area Color saturation shift: Left Stream 1 Codec: MPEG AAC Audio (mp4a) Language: English Type: Audio Channels: Stereo Sample Rate: 48000 Hz Bits per Sample: 32
When such a video file is started, I only get video but no audio.
What you will have to do is:

In Tools > Settings (all) > Input/Codecs > Videocodecs > List of preferred decoders, you will have to enter

Code: Select all

avcodec

and save. With that setting, the video in question plays fine, including audio. As soon as this avcodec entry is omitted, there is again silence instead of the audio.

Interesting: As soon as avcodec is enabled, the codec information changes from

Code: Select all

Channels: Stereo
to

Code: Select all

Channels: 3F2R/LFE
Looks like the default faad decoder is not able to determine the channel configuration and hence, just does not play any audio at all.

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 26 May 2021 22:08

As I cannot update my previous posting, I add this information here:

Without avcodec included in the list of preferred decoders, Video playback also stutters and has color artifacts (vlc 4.0.0).

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby InTheWings » 27 May 2021 09:55

no file no test no fix
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 27 May 2021 11:16

no file no test no fix
Problem is that the video file in question is copyright protected. I did a search for a free sample video file with the same specifications (as shown in VLC) but there, the error did not occur. Is there a way to get more comprehensive audio/video format information than the one shown in VLC's codec information window?
I started vlc from terminal with this video and get:

Code: Select all

VLC media player 4.0.0-dev Otto Chriek (revision 03674ae) [h264 @ 0x7fb41deb2b40] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x7fb41deb2b40] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0x7fb41deb2b40] nal_unit_type: 5(IDR), nal_ref_idc: 3 [swscaler @ 0x7fb4140e7440] Forcing full internal H chroma due to input having non subsampled chroma [h264 @ 0x7fb41deb2b40] Format yuv420p chosen by get_format(). [h264 @ 0x7fb41deb2b40] Reinit context to 1280x720, pix_fmt: yuv420p [h264 @ 0x7fb41deb2b40] no picture [h264 @ 0x7fb41defb900] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x7fb41defb900] no picture [h264 @ 0x7fb41df18600] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
Log file is here.

With avcodec set in the list of preferred decoders, I get the following (similar) output in the terminal:

Code: Select all

LC media player 4.0.0-dev Otto Chriek (revision 03674ae) [h264 @ 0x7f3879eb2b40] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x7f3879eb2b40] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0x7f3879eb2b40] nal_unit_type: 5(IDR), nal_ref_idc: 3 [swscaler @ 0x7f38700e5a00] Forcing full internal H chroma due to input having non subsampled chroma [h264 @ 0x7f3879eb2b40] Format yuv420p chosen by get_format(). [h264 @ 0x7f3879eb2b40] Reinit context to 1280x720, pix_fmt: yuv420p [h264 @ 0x7f3879eb2b40] no picture [h264 @ 0x7f3879efb900] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x7f3879efb900] no picture [h264 @ 0x7f3879f18600] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x7f3879f35300] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x7f3879f52000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x7f3879eb2b40] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x7f3879efb900] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
Log File is here.

Apparently, without avcodec, the main difference is here:

Code: Select all

pulse debug: started pulse debug: changing sink 0: alsa_output.pci-0000_00_1b.0.analog-stereo (Internes Audio Analog Stereo) qt warning: qml error qrc:/widgets/DragItem.qml:52 ReferenceError: g_mainDisplay is not defined ... qt debug: on_player_track_list_changed (audio) pulse error: overflow, flushing vlcpulse debug: write index corrupt
Consequently, I get

Code: Select all

main warning: picture is too late to be displayed (missing 4391 ms) main warning: picture is too late to be displayed (missing 4336 ms) main warning: picture is too late to be displayed (missing 4280 ms) main warning: picture is too late to be displayed (missing 4224 ms) main warning: picture is too late to be displayed (missing 4169 ms) ...
The same section with avcodec looks better:

Code: Select all

pulse debug: changing sink 0: alsa_output.pci-0000_00_1b.0.analog-stereo (Internes Audio Analog Stereo) pulse debug: started ... qt debug: on_player_track_list_changed (audio) main debug: looking for extension module matching "any": 1 candidates
- and there are no "picture is too late" errors.
Last edited by DAC324 on 27 May 2021 11:52, edited 3 times in total.

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby InTheWings » 27 May 2021 11:25

no file no test no fix
Problem is that the video file in question is copyright protected. I did a search for a free sample video file with the same specifications (as shown in VLC) but there, the error did not occur. Is there a way to get more comprehensive audio/video format information than the one shown in VLC's codec information window?
If you can't see the problem with other files, we also can't.
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 27 May 2021 12:04

If you can't see the problem with other files, we also can't.
Here is what mediainfo says about this file:

Code: Select all

General Complete name : vlc_test.720p.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 984 MiB Duration : 30 min 2 s Overall bit rate mode : Variable Overall bit rate : 4 579 kb/s Writing application : Lavf58.20.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 30 min 2 s Bit rate mode : Constant Bit rate : 3 933 kb/s Nominal bit rate : 6 000 kb/s Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 23.976 (24000/1001) FPS Minimum frame rate : 23.810 FPS Maximum frame rate : 24.390 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.178 Stream size : 845 MiB (86%) Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Codec configuration box : avcC Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 30 min 2 s Duration_LastFrame : -5 ms Bit rate mode : Constant Bit rate : 639 kb/s Channel(s) : 6 channels Channel layout : L R C Cb Lb Rb Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 137 MiB (14%) Language : English Default : Yes Alternate group : 1 Text ID : 3 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 29 min 54 s Bit rate mode : Variable Bit rate : 93 b/s Stream size : 20.3 KiB (0%) Title : English (CC) Language : English Default : Yes Forced : No Alternate group : 3

Rémi Denis-Courmont
Developer
Developer
Posts: 15214
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby Rémi Denis-Courmont » 27 May 2021 13:05

No sample, no bug. We can't do magic.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 27 May 2021 13:40

No sample, no bug. We can't do magic.
I understand. But I do not want to post a link to this file publicly here in the forum. Is there another way to send the sample to you?

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby InTheWings » 27 May 2021 14:49

:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

DAC324
Blank Cone
Blank Cone
Posts: 40
Joined: 04 Aug 2006 18:12

Re: No audio with MP4 video files using mp4a at 48 kHz sample rate

Postby DAC324 » 28 May 2021 14:27

File uploaded. Thanks a bunch for providing this opportunity.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 3 guests