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

mp4 files double length or won't play in QuickTime Player/iTunes? #5048

Closed
genericptr opened this issue Feb 24, 2015 · 13 comments
Closed

mp4 files double length or won't play in QuickTime Player/iTunes? #5048

genericptr opened this issue Feb 24, 2015 · 13 comments

Comments

@genericptr
Copy link

@genericptr genericptr commented Feb 24, 2015

When I try to download audio using mp4 formats (mp3 is never presented in -F) the audio length is 2x what the original is resulting in no volume empty space at the end of the track or total failure to play. I'm using a Mac and usually opening the files in QuickTime Player or iTunes (where the file won't play at all) when I see the problem but in VLC this doesn't happen. Is this a bug that needs fixing or should I try another utility to convert it to mp3 perhaps? Thanks.

@genericptr genericptr changed the title mp4 files double length in QuickTime Player/iTunes? mp4 files double length or won't play in QuickTime Player/iTunes? Feb 24, 2015
@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2015

Sorry, I don't understand what you are doing in the first place. Where are you downloading the videos from? How do you "download audio using mp4 formats"?

Note that mp3 can be present, it just depends on the service you're using. For instance:

$ youtube-dl -F http://www.audiomack.com/song/roosh-williams/extraordinary
[audiomack] roosh-williams/extraordinary: Downloading JSON metadata
[info] Available formats for 310086:
format code  extension  resolution note
0            mp3        unknown

So please elaborate on what you are doing. Don't forget to review or issue reporting guidelines. In particular, the output when called with -v should answer many of the above questions.

@genericptr
Copy link
Author

@genericptr genericptr commented Feb 24, 2015

Sorry I mistyped I meant m4a. I'm downloading from YouTube using -f 141 for example (141 m4a audio only DASH audio 256k , m4a_dash container, aac @256k (44100Hz), 22.38MiB) and haven't seem mp3 yet. I'm curious if it's a bug on your end or Apple's software is not compliment with the standard and I should be converting it.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2015

YouTube does not natively serve mp3. You can simply pass in -x --audio-format mp3 to let youtube-dl handle the conversion to mp3.

@genericptr
Copy link
Author

@genericptr genericptr commented Feb 24, 2015

Ok, I'll just ignore the problem then and try mp3. I'm looking for ffprobe now and I think it changed it's name to ffmpeg. Is that correct? If so maybe I just need to change the name and install to /usr/bin? Thanks.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2015

I still don't understand your problem in the first place, and since you are refusing to post the requested output of youtube-dl when called with -v I'm afraid I cannot really help you.

Note that YouTube's m4as are not playable by a large number of players. youtube-dl should auto-correct this when ffmpeg is installed, and warn otherwise.

ffprobe is a binary in the ffmpeg package. You can download the ffmpeg package at https://www.ffmpeg.org/download.html#build-mac .

Without the requested information (the output when called with -v) about the problem, I'm afraid we cannot help you. I am therefore closing this issue. Feel free to provide the output and we will reopen it. Thanks!

@phihag phihag closed this Feb 24, 2015
@genericptr
Copy link
Author

@genericptr genericptr commented Feb 24, 2015

Sorry I didn't post the output because it's a question about the specific format and how youtube-dl generated it internally, not that there was an error. You answered the question already though which is m4a is probably just a shaky format to use and I should convert it. Not sure where you want ffmpeg installed to but I do some research. Thanks.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2015

ffmpeg can go anywhere in your PATH. If you are installing it by hand instead of with a package manager or installer, /usr/local/bin is the preferred path to install to. If you want you can use an alternate location though, just specify --ffmpeg-location either on the command line or your configuration file.

@genericptr
Copy link
Author

@genericptr genericptr commented Feb 24, 2015

Thanks for your support but I'm still having problems. Installed ffmpeg to correct location but I can't get youtube-dl to locate it using 2 methods (below). The option --ffmpeg-location is not appearing in youtube-dl -h either.

MacBooks-MacBook-2:~ ryanjoseph$ /usr/local/bin/ffmpeg
ffmpeg version 2.5.3-tessus Copyright (c) 2000-2015 the FFmpeg developers

MacBooks-MacBook-2:~ ryanjoseph$ youtube-dl -v -f 141 -x --audio-format mp3 --ffmpeg-location /usr/local/bin/ffmpeg https://www.youtube.com/watch?v=DShCO4lrnFU
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: no such option: --ffmpeg-location

MacBooks-MacBook-2:~ ryanjoseph$ youtube-dl -v -f 141 -x --audio-format mp3 https://www.youtube.com/watch?v=DShCO4lrnFU
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', '141', '-x', '--audio-format', 'mp3', 'https://www.youtube.com/watch?v=DShCO4lrnFU']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.02.10.5
[debug] Python version 2.7.6 - Darwin-14.1.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.5.3-tessus
[debug] Proxy map: {}
[youtube] DShCO4lrnFU: Downloading webpage
[youtube] DShCO4lrnFU: Extracting video information
[youtube] DShCO4lrnFU: Downloading DASH manifest
[debug] Invoking downloader on 'https://r3---sn-w5nuxa-jomz.googlevideo.com/videoplayback?id=0d28423b896b9c55&itag=141&source=youtube&requiressl=yes&mm=31&mv=m&ms=au&pl=24&ratebypass=yes&mime=audio/mp4&gir=yes&clen=9651238&lmt=1424402263092566&dur=302.695&key=dg_yt0&fexp=905657,907263,916636,916930,927622,931359,934954,9405958,9406486,943917,945093,947225,947240,948124,952302,952605,952612,952901,953918,955301,957201,957906,959701&upn=i2kr-pXloug&mt=1424778054&sver=3&signature=02EDAE521F0308A5551F7C08917143A35EF1BD7A.786559B0380F55B201C760C5BEE1BC37ADF77812&ip=171.4.249.10&ipbits=0&expire=1424799704&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mv,ms,pl,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Q_bert's Qubes (Atari 2600) game review by Mike Matei-DShCO4lrnFU.m4a
[download] 100% of 9.20MiB in 00:41
[ffmpeg] Correcting container in "Q_bert's Qubes (Atari 2600) game review by Mike Matei-DShCO4lrnFU.m4a"
[debug] ffmpeg command line: ffmpeg -y -i 'Q_bert'"'"'s Qubes (Atari 2600) game review by Mike Matei-DShCO4lrnFU.m4a' -c copy -f mp4 'Q_bert'"'"'s Qubes (Atari 2600) game review by Mike Matei-DShCO4lrnFU.temp.m4a'
ERROR: ffprobe or avprobe not found. Please install one.
Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1425, in post_process
keep_video_wish, info = pp.run(info)
File "/usr/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 165, in run
filecodec = self.get_audio_codec(path)
File "/usr/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 131, in get_audio_codec
raise PostProcessingError('ffprobe or avprobe not found. Please install one.')
PostProcessingError

@phihag phihag reopened this Feb 24, 2015
@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2015

youtube-dl needs ffmpeg and ffprobe, both of which come in one package.

Additionally, your version of youtube-dl is out of date, and that's why --ffmpeg-location won't work (although it should not be necessary at all). See our FAQ if you need help updating.

@phihag phihag closed this Feb 24, 2015
@genericptr
Copy link
Author

@genericptr genericptr commented Feb 26, 2015

Thanks for all your support, I got it working now by installing the package from brew. However, for the record I found out my iTunes can indeed play m4a files without errors so there must be an error in the way youtube-dl generated the file which results in the extra space I was talking about (this didn't affect the file in VLC though). Probably not worth digging into since it's a fringe format but I wanted to let you know anyways. Thanks again.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2015

youtube-dl just transmits the file as YouTube renders it - we can reproduce the behavior just fine when using an external downloader. iTunes supports normal m4a files, but not the specific format generated by YouTube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@phihag @genericptr and others
You can’t perform that action at this time.