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

Using -x -f bestaudio wants to yield transcoded mp3 every time instead of native audio #23751

Closed
ultrasound1372 opened this issue Jan 15, 2020 · 5 comments

Comments

@ultrasound1372
Copy link

@ultrasound1372 ultrasound1372 commented Jan 15, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.01.15
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-x', '-f', 'bestaudio', '-o', 'dl/%(title)s.%(ext)s', '-v', 'https://www.youtube.com/watch?v=YIk5oxSnrIw']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.01.15
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg N-55702-g920046a, ffprobe N-55702-g920046a
[debug] Proxy map: {}
[youtube] YIk5oxSnrIw: Downloading webpage
[youtube] YIk5oxSnrIw: Downloading video info webpage
[youtube] {18} signature length 108, html5 player vfle4-e03
[youtube] YIk5oxSnrIw: Downloading player https://www.youtube.com/yts/jsbin/player_ias-vfle4-e03/en_US/base.js
[youtube] {137} signature length 112, html5 player vfle4-e03
[youtube] YIk5oxSnrIw: Downloading player https://www.youtube.com/yts/jsbin/player_ias-vfle4-e03/en_US/base.js
[youtube] {248} signature length 112, html5 player vfle4-e03
[youtube] {136} signature length 112, html5 player vfle4-e03
[youtube] {247} signature length 112, html5 player vfle4-e03
[youtube] {135} signature length 112, html5 player vfle4-e03
[youtube] {244} signature length 112, html5 player vfle4-e03
[youtube] {134} signature length 108, html5 player vfle4-e03
[youtube] {243} signature length 112, html5 player vfle4-e03
[youtube] {133} signature length 108, html5 player vfle4-e03
[youtube] {242} signature length 112, html5 player vfle4-e03
[youtube] {160} signature length 112, html5 player vfle4-e03
[youtube] {278} signature length 112, html5 player vfle4-e03
[youtube] {140} signature length 112, html5 player vfle4-e03
[youtube] {249} signature length 112, html5 player vfle4-e03
[youtube] {250} signature length 112, html5 player vfle4-e03
[youtube] {251} signature length 112, html5 player vfle4-e03
[debug] Invoking downloader on 'https://r4---sn-q4flrnek.googlevideo.com/videoplayback?expire=1579147738&ei=eo0fXtypCdCmDNe-paAI&ip=2605%3A6000%3A1100%3Ac47c%3A41c2%3A52d%3Af02b%3Ade01&id=o-ADdUlT6Uf7scjpQ412zWcz3FHNfocTg6QODWIGTd8EW4&itag=251&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-q4flrnek%2Csn-vgqsrn7l&ms=au%2Conr&mv=m&mvi=3&pl=32&initcwndbps=2050000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=104932514&dur=6397.041&lmt=1540471722700575&mt=1579126018&fvip=6&keepalive=yes&fexp=23842630&c=WEB&txp=5411222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhAO4gwY3T0H4vitbfH2kmbOzjeBnk7MaEXShj3D_pc89IAiEAj11wKjy9dKp1fg6mw7OMF079CX54gtM9toudHh5p2Yo%3D&sig=ALgxI2wwRQIhAN4IbHKhH8RyC3tLb9noNoJI74YmlEQ-wu4YpqI20XTcAiB7LWBolNuoPexjbEeNnJodFPdjkJ5ldzXx9bWkiE4gsA==&ratebypass=yes'
[download] Destination: dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm
[download] 100% of 100.07MiB in 00:10
[debug] ffmpeg command line: ffprobe -show_streams "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm"
[ffmpeg] Destination: dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm" -vn -acodec libmp3lame "-q:a" 5 "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.mp3"
Deleting original file dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm (pass -k to keep)

Description

I have noticed this for a few months but it has really started getting on my nerves recently. I am an audiophile and so I take issue with this. I use the foobar2000 component foo_youtube to play YouTube videos normally, so I am sometimes aware of the codecs available. Usually the component chooses AAC streams. However the download functionality of that is slow and also has to convert so I use youtube-dl to obtain the audio I need on my disk. When I saw that this binary was downloading this file to a WebM video, I figured it would give me an opus or ogg file with extract audio. But it appears no matter the input type, it wishes to transcode to mp3, while in mid-2019 it would happily give you the m4a, opus or ogg file that I assume it obtained from simply copying the audio codec. I do not appreciate this step being taken, especially since I had specified -f bestaudio and did not specify --audio-format mp3. Can the behavior be restored to that of previous versions or an option such as --no-transcode-audio be added to simply use -acodec copy in the ffmpeg arguments?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 15, 2020

> py -3.7 .\youtube_dl\__main__.py -x -f bestaudio -o 'dl/%(title)s.%(ext)s' -v https://www.youtube.com/watch?v=YIk5oxSnrIw
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-x', '-f', 'bestaudio', '-o', 'dl/%(title)s.%(ext)s', '-v', 'https://www.youtube.com/watch?v=YIk5oxSnrIw']
[debug] Encodings: locale cp1251, fs utf-8, out utf-8, pref cp1251
[debug] youtube-dl version 2020.01.15
[debug] Git HEAD: 90ea83c
[debug] Python version 3.7.0 (CPython) - Windows-10-10.0.10240-SP0
[debug] exe versions: ffmpeg N-85653-gb4330a0, ffprobe N-85653-gb4330a0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] YIk5oxSnrIw: Downloading webpage
[youtube] YIk5oxSnrIw: Downloading video info webpage
[youtube] {18} signature length 102, html5 player vflWQEEag
[youtube] {137} signature length 106, html5 player vflWQEEag
[youtube] {248} signature length 102, html5 player vflWQEEag
[youtube] {136} signature length 102, html5 player vflWQEEag
[youtube] {247} signature length 102, html5 player vflWQEEag
[youtube] {135} signature length 106, html5 player vflWQEEag
[youtube] {244} signature length 106, html5 player vflWQEEag
[youtube] {134} signature length 102, html5 player vflWQEEag
[youtube] {243} signature length 102, html5 player vflWQEEag
[youtube] {133} signature length 102, html5 player vflWQEEag
[youtube] {242} signature length 102, html5 player vflWQEEag
[youtube] {160} signature length 106, html5 player vflWQEEag
[youtube] {278} signature length 106, html5 player vflWQEEag
[youtube] {140} signature length 106, html5 player vflWQEEag
[youtube] {249} signature length 106, html5 player vflWQEEag
[youtube] {250} signature length 102, html5 player vflWQEEag
[youtube] {251} signature length 106, html5 player vflWQEEag
[debug] Invoking downloader on '...'
[download] Destination: dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm
[download] 100% of 100.07MiB in 00:09
[debug] ffmpeg command line: ffprobe -show_streams "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm"
[ffmpeg] Destination: dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.opus
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm" -vn -acodec copy "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.opus"
Deleting original file dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm (pass -k to keep)
@dstftw dstftw closed this Jan 15, 2020
@ytdl-org ytdl-org deleted a comment from bitraid Jan 15, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 15, 2020

Most likely your ancient ffmpeg either fails to detect opus audio codec properly or returns unexpected value.
Post the output of ffprobe -show_streams "file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm".

@ultrasound1372
Copy link
Author

@ultrasound1372 ultrasound1372 commented Jan 16, 2020

It yields the following, though my ffmpeg build should be much later than this, I'm using the Zeranoe builds that I downloaded like a few months ago but maybe ffprobe just wasn't updated? I'll try updating my ffmpeg with the latest betas from there which have dates that are much more recent in the build names.


ffprobe version N-55702-g920046a Copyright (c) 2007-2013 the FFmpeg developers
  built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.101 / 55. 14.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0000000002648680] Unknown entry 0x56AA
[matroska,webm @ 0000000002648680] Unknown entry 0x56BB
Input #0, matroska,webm, from 'file:dl\'Peer Gynt' Complete Incidental Music - Edvard Grieg.webm':
  Duration: 01:46:37.04, start: 0.000000, bitrate: 131 kb/s
    Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, s16 (default)
[STREAM]
index=0
codec_name=libopus
codec_long_name=libopus Opus
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s16
sample_rate=48000
channels=2
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
[/STREAM]

Is that unknown stuff why it wants to yield an mp3? I'm all binaries here, ffmpeg builds from Zeranoe and youtube-dl from the website which is in my path.

@ultrasound1372
Copy link
Author

@ultrasound1372 ultrasound1372 commented Jan 16, 2020

Okay it turns out the reason it was using an ancient ffmpeg was because it was using something from my python scripts directory instead of the one that I put in my path. I'll see if making it actually use the updated binaries yields things properly, that would explain why this only started happening recently.

@ultrasound1372
Copy link
Author

@ultrasound1372 ultrasound1372 commented Jan 16, 2020

Okay yes, the reason it was doing this was unrelated to youtube-dl and was actually caused by a rogue ffmpeg binary that I didn't know about. Sorry for wasting your time.

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