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

can't find matching .m4a for .mp4, downloads .webm audio instead #13176

Closed
pts opened this issue May 20, 2017 · 3 comments
Closed

can't find matching .m4a for .mp4, downloads .webm audio instead #13176

pts opened this issue May 20, 2017 · 3 comments
Labels

Comments

@pts
Copy link

@pts pts commented May 20, 2017

  • I've verified and I assure that I'm running youtube-dl 2017.05.18.1
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Bug report (encountered problems with youtube-dl)
$ youtube-dl -v -F https://www.youtube.com/watch?v=lw6j4VgzzTc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/watch?v=lw6j4VgzzTc']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.05.18.1
[debug] Python version 2.7.6 - Linux-4.4.0-75-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6, rtmpdump 2.4
[debug] Proxy map: {'auto': 'https://proxyconfig.corp.google.com/proxy.pac'}
[youtube] lw6j4VgzzTc: Downloading webpage
[youtube] lw6j4VgzzTc: Downloading embed webpage
[youtube] lw6j4VgzzTc: Refetching age-gated info webpage
[youtube] lw6j4VgzzTc: Extracting video information
[info] Available formats for lw6j4VgzzTc:
format code  extension  resolution note
249          webm       audio only DASH audio   49k , opus @ 50k, 55.85KiB
250          webm       audio only DASH audio   65k , opus @ 70k, 74.16KiB
171          webm       audio only DASH audio   84k , vorbis@128k, 95.82KiB
140          m4a        audio only DASH audio   95k , m4a_dash container, mp4a.40.2@128k, 109.20KiB
251          webm       audio only DASH audio   96k , opus @160k, 109.13KiB
278          webm       82x144     144p   37k , webm container, vp9, 30fps, video only, 42.88KiB
160          mp4        82x144     144p   38k , avc1.4d400b, 30fps, video only, 42.93KiB
242          webm       136x240    144p   77k , vp9, 30fps, video only, 86.77KiB
133          mp4        136x240    144p   81k , avc1.4d400c, 30fps, video only, 91.65KiB
243          webm       204x360    240p  142k , vp9, 30fps, video only, 160.62KiB
134          mp4        204x360    240p  205k , avc1.4d400d, 30fps, video only, 232.26KiB
244          webm       270x480    240p  261k , vp9, 30fps, video only, 295.24KiB
135          mp4        270x480    240p  368k , avc1.4d4015, 30fps, video only, 418.59KiB
247          webm       406x720    360p  528k , vp9, 30fps, video only, 593.70KiB
136          mp4        406x720    360p  740k , avc1.4d401e, 30fps, video only, 838.75KiB
248          webm       608x1080   480p  943k , vp9, 30fps, video only, 1.02MiB
137          mp4        608x1080   480p 1381k , avc1.64001f, 30fps, video only, 1.53MiB
271          webm       720x1280   720p 2253k , vp9, 30fps, video only, 2.46MiB
264          mp4        720x1280   720p 2602k , avc1.64001f, 30fps, video only, 2.88MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        136x240    small , mp4v.20.3, mp4a.40.2
18           mp4        202x360    medium , avc1.42001E, mp4a.40.2@ 96k
43           webm       640x360    medium , vp8.0, vorbis@128k
22           mp4        406x720    hd720 , avc1.64001F, mp4a.40.2@192k (best)

Incorrect default behavior:

$ $ youtube-dl -v https://www.youtube.com/watch?v=lw6j4VgzzTc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=lw6j4VgzzTc']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.05.18.1
[debug] Python version 2.7.6 - Linux-4.4.0-75-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6, rtmpdump 2.4
[debug] Proxy map: {'auto': 'https://proxyconfig.corp.google.com/proxy.pac'}
[youtube] lw6j4VgzzTc: Downloading webpage
[youtube] lw6j4VgzzTc: Downloading embed webpage
[youtube] lw6j4VgzzTc: Refetching age-gated info webpage
[youtube] lw6j4VgzzTc: Extracting video information
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r3---sn-4g57kn6z.googlevideo.com/videoplayback?expire=1495341374&id=o-AJX2-H8ZmkYKteAwU74mLTr5y9HIagaHaiDGTsNNOWRF&lmt=1495203680131218&ip=77.59.129.137&ei=3sQgWY6fCMLYcJ_9h6AK&pl=20&beids=%5B9466592%5D&initcwndbps=1592500&source=youtube&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=q8b18zTvYXc&key=yt6&keepalive=yes&clen=3022755&mime=video%2Fmp4&ipbits=0&requiressl=yes&dur=9.299&mv=m&mt=1495319660&ms=au&mn=sn-4g57kn6z&signature=878003A61049171DCA76E40F0E37474BFC0FE7BF.7143889E1B57BADDAE549C69C16F09A176D8C519&mm=31&itag=264&gir=yes&ratebypass=yes'
[download] Destination: Upskirt-lw6j4VgzzTc.f264.mp4
[download] 100% of 2.88MiB in 00:26
[debug] Invoking downloader on u'https://r3---sn-4g57kn6z.googlevideo.com/videoplayback?expire=1495341374&id=o-AJX2-H8ZmkYKteAwU74mLTr5y9HIagaHaiDGTsNNOWRF&lmt=1495079119960962&ip=77.59.129.137&ei=3sQgWY6fCMLYcJ_9h6AK&pl=20&beids=%5B9466592%5D&initcwndbps=1592500&source=youtube&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=q8b18zTvYXc&key=yt6&keepalive=yes&clen=111753&mime=audio%2Fwebm&ipbits=0&requiressl=yes&dur=9.301&mv=m&mt=1495319660&ms=au&mn=sn-4g57kn6z&signature=1BC3AB446BBFC1C3C47D6B331F0006A814FD9762.74E256E22CAAB709F3292AA854D33230B51AF409&mm=31&itag=251&gir=yes&ratebypass=yes'
[download] Destination: Upskirt-lw6j4VgzzTc.f251.webm
[download] 100% of 109.13KiB in 00:00
[ffmpeg] Merging formats into "Upskirt-lw6j4VgzzTc.mkv"
[debug] ffmpeg command line: avconv -y -i file:Upskirt-lw6j4VgzzTc.f264.mp4 -i file:Upskirt-lw6j4VgzzTc.f251.webm -c copy -map 0:v:0 -map 1:a:0 file:Upskirt-lw6j4VgzzTc.temp.mkv
Deleting original file Upskirt-lw6j4VgzzTc.f264.mp4 (pass -k to keep)
Deleting original file Upskirt-lw6j4VgzzTc.f251.webm (pass -k to keep)

Manual workaround is specifying format numbers:

$ youtube-dl -v -f 264+140 https://www.youtube.com/watch?v=lw6j4VgzzTc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'264+140', u'https://www.youtube.com/watch?v=lw6j4VgzzTc']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.05.18.1
[debug] Python version 2.7.6 - Linux-4.4.0-75-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6, rtmpdump 2.4
[debug] Proxy map: {'auto': 'https://proxyconfig.corp.google.com/proxy.pac'}
[youtube] lw6j4VgzzTc: Downloading webpage
[youtube] lw6j4VgzzTc: Downloading embed webpage
[youtube] lw6j4VgzzTc: Refetching age-gated info webpage
[youtube] lw6j4VgzzTc: Extracting video information
[debug] Invoking downloader on u'https://r3---sn-4g57kn6z.googlevideo.com/videoplayback?ms=au&mt=1495319780&mv=m&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&ip=77.59.129.137&requiressl=yes&id=o-AOGdd2W_AuKQ7XvG791wOUmF2pcuvdNbKlQR3WGMYjSC&pl=20&mm=31&mn=sn-4g57kn6z&expire=1495341457&ipbits=0&dur=9.299&gir=yes&mime=video%2Fmp4&key=yt6&clen=3022755&itag=264&source=youtube&upn=p-agMBAC9aY&lmt=1495203680131218&signature=4FD82CD4B228AA6269EDED34E4FCBA992B82D75E.8723217F7599B493BACCC231211AFBB06055B697&ei=McUgWbrMGomtc5uwt_gL&initcwndbps=1607500&keepalive=yes&ratebypass=yes'
[download] Destination: Upskirt-lw6j4VgzzTc.f264.mp4
[download] 100% of 2.88MiB in 00:02
[debug] Invoking downloader on u'https://r3---sn-4g57kn6z.googlevideo.com/videoplayback?ms=au&mt=1495319780&mv=m&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&ip=77.59.129.137&requiressl=yes&id=o-AOGdd2W_AuKQ7XvG791wOUmF2pcuvdNbKlQR3WGMYjSC&pl=20&mm=31&mn=sn-4g57kn6z&expire=1495341457&ipbits=0&dur=9.357&gir=yes&mime=audio%2Fmp4&key=yt6&clen=111822&itag=140&source=youtube&upn=p-agMBAC9aY&lmt=1495203590734521&signature=1C372690369802372788D68126B56639C53BB847.5D1214A66016F824DF5DA1A34BD899BF20921A6E&ei=McUgWbrMGomtc5uwt_gL&initcwndbps=1607500&keepalive=yes&ratebypass=yes'
[download] Destination: Upskirt-lw6j4VgzzTc.f140.m4a
[download] 100% of 109.20KiB in 00:00
[ffmpeg] Merging formats into "Upskirt-lw6j4VgzzTc.mp4"
[debug] ffmpeg command line: avconv -y -i file:Upskirt-lw6j4VgzzTc.f264.mp4 -i file:Upskirt-lw6j4VgzzTc.f140.m4a -c copy -map 0:v:0 -map 1:a:0 file:Upskirt-lw6j4VgzzTc.temp.mp4
Deleting original file Upskirt-lw6j4VgzzTc.f264.mp4 (pass -k to keep)
Deleting original file Upskirt-lw6j4VgzzTc.f140.m4a (pass -k to keep)

Expected behavior: the following command should create an .mp4 file:

$ youtube-dl -v https://www.youtube.com/watch?v=lw6j4VgzzTc
@Hrxn
Copy link

@Hrxn Hrxn commented May 20, 2017

The default behaviour is: --format "bestvideo+bestaudio/best".

This means: First priority is getting the best video stream possible, the best audio stream possible, and then merge these into a file.

And in your example format code 251 is bestaudio, as intended. So, working as expected.
Format code 140, what you requested, is ranked lower by youtube-dl, as it should be, from a technical standpoint.

What you can do is something like that:

--format "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio/best"

Or

--format "bestvideo[ext=webm]+bestaudio[ext=webm]/bestvideo+bestaudio/best"
If you want..

@pts
Copy link
Author

@pts pts commented May 21, 2017

Thank you for your suggestions!

This is what would be the best for me:

--format "bestvideo+bestaudio[compatiblewithvideo]/bestvideo+bestaudio/best"

compatiblewidthvideo means: an audio format which doesn't trigger the Requested formats are incompatible warning with the chosen video format.

The reason I prefer this is that better file format compatibility (thus better playability and editability in the future) is more important for me than a minor audio quality improvement.

@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 21, 2017

duplicate of #10226.

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
3 participants
You can’t perform that action at this time.