Problem playing m4a tracks... with a solution

Fixxx your Mixxx

Moderator: garth

Problem playing m4a tracks... with a solution

Postby Piscium » Sat Jan 17, 2015 4:35 pm

The default Youtube audio format is aac/m4a. I downloaded a number of audio files from Youtube with file extension m4a. The problem I have is that I can not play these files with Mixxx 1.11.

One example of files I cannot play with Mixxx is “6n73tOSV6-M.m4a” [1] whose Youtube original is at [2]. I can however play this type of files with Quod Libet, Vlc, Amarok, Banshee, Clementine, Audacious, mplayer, etc.

I spent some time investigating this and my conclusion is that Mixxx cannot play some m4a files because they are not supported by the Faad decoder. Other players can play these files because they use a different decoder, FFMpeg.

Development of the Faad player seems to have stopped as the most current version (2.7) was released almost 6 years ago [3]. The fact that the software is so old (obsolete?) may be the reason why it cannot support Youtube videos.

The problem with Faad can be demonstrated by running the faad command as below. It tells me (incorrectly) that the track is 0 seconds long.

Code: Select all
$ faad -i 6n73tOSV6-M.m4a
 *********** Ahead Software MPEG-4 AAC Decoder V2.7 ******************

 Build: Dec 30 2013
 Copyright 2002-2004: Ahead Software AG
 http://www.audiocoding.com
 Floating point version

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License.

 **************************************************************************

6n73tOSV6-M.m4a file info:

LC AAC   0.000 secs, 2 ch, 44100 Hz


By contrast ffprobe, a program in the FFMpeg suite, tells me (correctly) that the track is 2:35.09 long.

Code: Select all
$ ffprobe 6n73tOSV6-M.m4a
ffprobe version 2.1.7 Copyright (c) 2007-2014 the FFmpeg developers
  built on Jan  3 2015 22:57:36 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '6n73tOSV6-M.m4a':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2013-09-14 07:49:59
  Duration: 00:02:35.09, start: 0.000000, bitrate: 255 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 253 kb/s (default)
    Metadata:
      creation_time   : 2013-09-14 07:49:59
      handler_name    : SoundHandler


Having discovered the root issue my next step was to attempt to build Mixxx 1.11 with the FFMpeg option enabled. This did not work. In fact this option is correctly marked as not working. I then looked at the Mixxx issue list in Launchpad and found that FFMpeg support in the Mixxx git master was recently re-enabled. I then cloned the Mixxx git master and built it (on Fedora 20) with the FFMpeg option enabled. This fixed the problem without having to enable the obsolete Faad option.

Thanks to the Mixxx developers for the good work with the future 1.12 version!

[1] https://www.sendspace.com/file/r77yps
[2] https://www.youtube.com/watch?v=6n73tOSV6-M
[3] http://www.audiocoding.com
Piscium
 
Posts: 10
Joined: Sat Jan 17, 2015 3:10 pm
Location: Dublin, Ireland

Re: Problem playing m4a tracks... with a solution

Postby cccsback » Wed Jun 03, 2015 12:28 am

I have ver 1.12 and it shows M4A plugin installed, but files won't play.
cccsback
 
Posts: 2
Joined: Wed Jun 03, 2015 12:25 am

Re: Problem playing m4a tracks... with a solution

Postby daschuer » Wed Jun 03, 2015 10:51 am

Which revision of Mixxx do you use and on which OS?
daschuer
Mixxx Developer
 
Posts: 1239
Joined: Sun Mar 10, 2013 11:26 am

Re: Problem playing m4a tracks... with a solution

Postby tapir » Wed Jun 03, 2015 4:29 pm

Files downloaded from YouTube are packaged in an MPEG-DASH container which is not supported by FAAD2:
http://en.wikipedia.org/wiki/Dynamic_Ad ... _over_HTTP

Currently only the FFmpeg SoundSource is able to play these files.
tapir
Mixxx Developer
 
Posts: 329
Joined: Sat Aug 04, 2012 12:03 pm
Location: Stuttgart

Re: Problem playing m4a tracks... with a solution

Postby daschuer » Thu Jun 04, 2015 6:23 am

A nother reason for including FFmpeg SoundSource as backup :-)

Is there a way to unpack the sound stream inside Mixxx?
https://github.com/bitmovin/libdash

Would you mind to file a bug for MPEG-DASH support?
daschuer
Mixxx Developer
 
Posts: 1239
Joined: Sun Mar 10, 2013 11:26 am

Re: Problem playing m4a tracks... with a solution

Postby tapir » Thu Jun 04, 2015 7:29 am

Just noticed that we are still talking about an MP4 container here, but the the atom ftyp "dash" instead of "m4a ". MPEG-DASH seems to be a different container format that uses the file extension ".mpd".

I will file a bug.
tapir
Mixxx Developer
 
Posts: 329
Joined: Sat Aug 04, 2012 12:03 pm
Location: Stuttgart

Re: Problem playing m4a tracks... with a solution

Postby tapir » Thu Jun 04, 2015 7:39 am

tapir
Mixxx Developer
 
Posts: 329
Joined: Sat Aug 04, 2012 12:03 pm
Location: Stuttgart

Re: Problem playing m4a tracks... with a solution

Postby daschuer » Thu Jun 04, 2015 10:26 pm

What does it mean here?
Is FFMPEG smart enough to detect the right MIME type even though the file extension is wrong?
daschuer
Mixxx Developer
 
Posts: 1239
Joined: Sun Mar 10, 2013 11:26 am

Re: Problem playing m4a tracks... with a solution

Postby tapir » Thu Jun 04, 2015 10:39 pm

The file extension is correct, it is still a valid MP4 container. There is another file extension .mpd used for MPEG-DASH containers. Anyway, FFmpeg is able to decode MP4/.m4a files with the ftyp="dash" content.

I've already tested it with a preliminary prototype of the extended plugin framework. FFmpeg will be used as a fallback when the FAAD2 decoder fails to open the file. Some warnings will appear in the log that indicate the switch to another SoundSource provider.

Edit: I noticed that FFmpeg playback is far from perfect. When seeking through the track playback skips and there are moments of silence. Before recommending FFmpeg this needs to be fixed, too.
tapir
Mixxx Developer
 
Posts: 329
Joined: Sat Aug 04, 2012 12:03 pm
Location: Stuttgart

Re: Problem playing m4a tracks... with a solution

Postby tapir » Fri Jun 05, 2015 12:28 pm

As a workaround you can use FFmpeg to transform these files into regular M4A audio files:
Code: Select all
ffmpeg -i input.m4a -vn -acodec copy output.m4a

This is a lossless process that only reorders the audio data in the MP4 container from "dash" to "m4a " contents.

See also: http://superuser.com/questions/837067/c ... 4a-aac-dl/
tapir
Mixxx Developer
 
Posts: 329
Joined: Sat Aug 04, 2012 12:03 pm
Location: Stuttgart

Next

Return to Troubleshooting & FAQ

Who is online

Users browsing this forum: No registered users and 4 guests