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

Fragmented AAC MP4 (dash ftyp) support #1663

Open
cipricus opened this issue Oct 25, 2016 · 14 comments
Open

Fragmented AAC MP4 (dash ftyp) support #1663

cipricus opened this issue Oct 25, 2016 · 14 comments

Comments

@cipricus
Copy link

cipricus commented Oct 25, 2016

This doesn't happen with all m4a files. I do not have too many such files to be able to compare a lot, what I have are audio files that all come from Youtube, downloaded directly as m4a audio files or extracted without conversion from mp4 video files (with a command like 'ffmpeg -i video.mp4 -vn -acodec copy audio.m4a').

Deadbeef can play directly (as audio-only) the mp4 (video) files; the m4a extracted with the above command from those mp4 videos can be played by db.

Deadbeef cannot play the m4a downloaded from youtube as m4a audio with the program SMTube. (Some more details on that program action: http://unix.stackexchange.com/a/229812/32012). I think this program captures the stream through youtube-dl, then uses uGet to download if that is installed.

Trying another program that can download m4a directly from youtube, MPS (http://www.webupd8.org/2014/03/command-line-youtube-player-mps-youtube.html) I get m4a files that can be played by deadbeef.

So, there must be something wrong with those files that are downloaded by SMTube.

But ALL other players that I have tested (Audacious, Clementine, VLC, MPV) can play the incriminated files(s) and also I would very much prefer to keep using the SMTube program for the mentioned purpose.

Tested this on db 0.7.2, also on master and the older 0.5.4.

I will also send by mail the links with samples for the mentioned files.

@Oleksiy-Yakovenko
Copy link
Member

Thanks for the bug report, please send one example file to me, and we'll figure it out.

@cipricus
Copy link
Author

I have sent two versions of the same m4a/aac audio, one working and one not.

@cipricus
Copy link
Author

cipricus commented Oct 25, 2016

Also, even the mp4 video files downloaded by SMTube (that is, through uGet) can be played by Deadbeef.

@cipricus
Copy link
Author

cipricus commented Oct 25, 2016

This is not limited to SMTube: I have tested other method of directly downloading the youtube audio (using Flashgot addon in Firefox, details on the above stackexchange link) and it gets an aac file that cannot be played in db.

@Oleksiy-Yakovenko
Copy link
Member

Oleksiy-Yakovenko commented Oct 25, 2016

The file that doesn't play is very special. It doesn't contain the information, that's normally expected from mp4 aac files, and the info in the file says that it's 0 length.

However, the file contains mp4 atom called "sidx", which deadbeef does not recognize, and I'm trying to find out what this atom supposed to contain.

It seems to be a fragmented mp4 stream, and indeed the file contains multiple moof atoms.

It will take some work to make this play.

@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Cannot play some m4a/aac files downloaded from Youtube (that other players can play) Fragmented AAC MP4 support Oct 25, 2016
@Oleksiy-Yakovenko
Copy link
Member

I'm not sure whether the current linux builds of deadbeef include ffmpeg with AAC support, but you could add M4A to the ffmpeg plugin file extension list (in the UI), and then try loading the file again.

This works for me on macOS, the file plays, but the whole player freezes if I try to seek in the file.

When I have time, I will try to add sidx/moof support to mp4ff, and write a native demuxer for fragmented mp4 files, but this would take several days of my time, and I don't know when I have that.

@Oleksiy-Yakovenko
Copy link
Member

For the reference, the atoms like sidx are documented here

@cipricus
Copy link
Author

Adding m4a in the ffmpeg player plugin list of extensions, it still doesn't work.

(Checking "Use all extensions supported by ffmpeg" makes db unable to play all files!)

@Oleksiy-Yakovenko
Copy link
Member

Oleksiy-Yakovenko commented Oct 26, 2016

Checking "Use all extensions supported by ffmpeg" makes db unable to play all files!

yeah, I know.. this is why it's off by default.

it works in some ffmpeg versions, and doesn't in others..

@kybos
Copy link

kybos commented Nov 13, 2016

Adding m4a in the ffmpeg player plugin list of extensions seems to work perfectly for me (even seeking).
Ubuntu 16.04

@kybos
Copy link

kybos commented Nov 13, 2016

Could be helpful:
ytdl-org/youtube-dl#3681

@wdlkmpx
Copy link
Contributor

wdlkmpx commented Nov 14, 2016

I also noticed deadbeef doesn't play m4a files downloaded from youtube. however if i change the extension to .aac it does play them.

interesting that using the ffmpeg player works. it would also be interesting to compile a deadbeef that only uses ffmpeg to see how small it can be. maybe following mplayer's style: download and compile a specific version of ffmpeg and with a specific config..

@Oleksiy-Yakovenko
Copy link
Member

I also noticed deadbeef doesn't play m4a files downloaded from youtube. however if i change the extension to .aac it does play them.

It's because in this case deadbeef ignores the container, and just finds the AAC frames directly in the stream. It's fairly "fail-proof", so sometimes the mp4 files could successfully play through "raw-aac" code path.

it would also be interesting to compile a deadbeef that only uses ffmpeg to see how small it can be.

Deadbeef is modular. You can see the size of each individual plugin (including ffmpeg).

@cipricus
Copy link
Author

cipricus commented Mar 21, 2017

Testing again with 0.7.2 in Solus Linux, I can confirm that adding m4a in the ffmpeg player plugin list of extensions fixes it for me too. #1663 (comment)

@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Fragmented AAC MP4 support Fragmented AAC MP4 (dash ftyp) support Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants