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

dash mp4: bitrate 0 #366

Open
razaqq opened this issue Dec 21, 2018 · 7 comments
Open

dash mp4: bitrate 0 #366

razaqq opened this issue Dec 21, 2018 · 7 comments

Comments

@razaqq
Copy link

razaqq commented Dec 21, 2018

import mutagen

f = mutagen.File("filename.m4a")
print("Length: {}s; Bitrate: {}; Sample Rate: {}; Bits per Sample: {}".format(f.info.length, f.info.bitrate, f.info.sample_rate, f.info.bits_per_sample))

output:

Length: 342.12281179138324s; Bitrate: 0; Sample Rate: 44100; Bits per Sample: 16

I tried on a lot of different files, always getting bitrate 0

@lazka
Copy link
Member

lazka commented Dec 21, 2018

Can you provide an example file somehow (or send it to me reiter.christoph@gmail.com) ?

@razaqq
Copy link
Author

razaqq commented Dec 21, 2018

sure ill send you a couple via mail

@razaqq
Copy link
Author

razaqq commented Dec 21, 2018

sent!

btw they were created via https://github.com/ritiek/spotify-downloader, which also uses mutagen

@lazka
Copy link
Member

lazka commented Dec 21, 2018

Thanks.

Hm, it's a DASH file, and the bitrate in the file is set to 0 (unknown).

I see there is a sidx atom which contains a list of segment sizes and in the tkhd atom there is a track ID to match that. Maybe we can calculate the bitrate from there.

@lazka lazka changed the title Bitrate 0 mp4: bitrate 0 Dec 22, 2018
@lazka
Copy link
Member

lazka commented Dec 22, 2018

ok, sidx just has offsets. using tfhd+trun works though..., see ISO_IEC_14496-12_2012

@lazka
Copy link
Member

lazka commented Dec 22, 2018

ok, for reference, one can get these types of files through

youtube-dl --fixup never -f 140 "https://www.youtube.com/watch?v=j5oaCPCqN3Y"

youtube-dl will by default convert the dash files to normal mp4 files: https://github.com/rg3/youtube-dl/blob/d4a24f4091a622b808ff621e78b5cfd0db3c8c11/youtube_dl/postprocessor/ffmpeg.py#L520

You should report this to spotify-downloader as it likely will cause incompatibilities with various software.

@lazka lazka changed the title mp4: bitrate 0 dash mp4: bitrate 0 Dec 22, 2018
@razaqq
Copy link
Author

razaqq commented Dec 25, 2018

thanks for looking into it! Will report it to them.

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

2 participants