bestvideo+bestaudio, webm+m4a problem #4034

Closed
opened 2026-02-21 00:06:23 -05:00 by deekerman · 8 comments
Owner

Originally created by @mati8 on GitHub (Feb 8, 2015).

Hi,

  • the problem: when using bestvideo+bestaudio, somtimes a webm file is downloaded, that can't be merged with a m4a.
  • how it could be fixed: a filter to download just the best "mp4".
  • my proposed solution would be something like: youtube-dl https://www.youtube.com/watch?v=-da2L9wY-rc -f bestvideo[format=mp4]+bestaudio

(there is already a post here about it: https://github.com/rg3/youtube-dl/issues/4886#issuecomment-73402243 )

OUTPUT when I encounter this error:
[root@M youtubemt]# youtube-dl https://www.youtube.com/watch?v=-da2L9wY-rc -f bestvideo+bestaudio -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=-da2L9wY-rc', '-f', 'bestvideo+bestaudio', '-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.02.06
[debug] Python version 2.6.6 - Linux-2.6.32-504.8.1.el6.i686-i686-with-centos-6.6-Final
[debug] exe versions: ffmpeg N-69617-gf05efd4-syslint, ffprobe present
[debug] Proxy map: {}
[youtube] -da2L9wY-rc: Downloading webpage
[youtube] -da2L9wY-rc: Extracting video information
[youtube] -da2L9wY-rc: Downloading DASH manifest
[debug] Invoking downloader on 'https://r19---sn-hpa7enee.googlevideo.com/videoplayback?id=f9d6b62fdc18fab7&itag=248&source=youtube&requiressl=yes&pl=20&mm=31&ms=au&mv=u&ratebypass=yes&mime=video/webm&gir=yes&clen=70786311&lmt=1413326274191051&dur=135.433&key=dg_yt0&sver=3&fexp=907263,927622,930676,9405619,9405975,9406817,943917,947225,948124,949429,952302,952605,952612,952901,955301,957201,959701&mt=1423418732&signature=5E5BE4B8589E29AD1D5BFD1EAA0476E8A61537A2.4A3516E6AE7AB0C34A59628904556F7BEEBC508B&upn=eZNNLsMW3h8&ip=5.249.137.176&ipbits=0&expire=1423440489&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,ms,mv,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f248.webm
[download] 100% of 67.51MiB in 00:01
[debug] Invoking downloader on 'https://r19---sn-hpa7enee.googlevideo.com/videoplayback?id=f9d6b62fdc18fab7&itag=141&source=youtube&requiressl=yes&pl=20&mm=31&ms=au&mv=u&ratebypass=yes&mime=audio/mp4&gir=yes&clen=4324017&lmt=1387951441332228&dur=135.604&key=dg_yt0&sver=3&fexp=907263,927622,930676,9405619,9405975,9406817,943917,947225,948124,949429,952302,952605,952612,952901,955301,957201,959701&mt=1423418732&signature=78546D1C5EAA8C1A3156BBD8399CA6104CAE07D5.1755AFC10C792C8593D23A89A78AA00258579395&upn=eZNNLsMW3h8&ip=5.249.137.176&ipbits=0&expire=1423440489&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,ms,mv,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f141.m4a
[download] 100% of 4.12MiB in 00:00
[ffmpeg] Merging formats into "GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.webm"
[debug] ffmpeg command line: ffmpeg -y -i 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f248.webm' -i 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f141.m4a' -c copy -map 0✌️0 -map 1🅰️0 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.webm'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1391, in post_process
keep_video_wish, info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 545, in run
self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 103, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError

Thank you!

Originally created by @mati8 on GitHub (Feb 8, 2015). Hi, - the problem: when using bestvideo+bestaudio, somtimes a webm file is downloaded, that can't be merged with a m4a. - how it could be fixed: a filter to download just the best "mp4". - my proposed solution would be something like: youtube-dl https://www.youtube.com/watch?v=-da2L9wY-rc -f bestvideo[format=mp4]+bestaudio (there is already a post here about it: https://github.com/rg3/youtube-dl/issues/4886#issuecomment-73402243 ) OUTPUT when I encounter this error: [root@M youtubemt]# youtube-dl https://www.youtube.com/watch?v=-da2L9wY-rc -f bestvideo+bestaudio -v [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['https://www.youtube.com/watch?v=-da2L9wY-rc', '-f', 'bestvideo+bestaudio', '-v'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2015.02.06 [debug] Python version 2.6.6 - Linux-2.6.32-504.8.1.el6.i686-i686-with-centos-6.6-Final [debug] exe versions: ffmpeg N-69617-gf05efd4-syslint, ffprobe present [debug] Proxy map: {} [youtube] -da2L9wY-rc: Downloading webpage [youtube] -da2L9wY-rc: Extracting video information [youtube] -da2L9wY-rc: Downloading DASH manifest [debug] Invoking downloader on 'https://r19---sn-hpa7enee.googlevideo.com/videoplayback?id=f9d6b62fdc18fab7&itag=248&source=youtube&requiressl=yes&pl=20&mm=31&ms=au&mv=u&ratebypass=yes&mime=video/webm&gir=yes&clen=70786311&lmt=1413326274191051&dur=135.433&key=dg_yt0&sver=3&fexp=907263,927622,930676,9405619,9405975,9406817,943917,947225,948124,949429,952302,952605,952612,952901,955301,957201,959701&mt=1423418732&signature=5E5BE4B8589E29AD1D5BFD1EAA0476E8A61537A2.4A3516E6AE7AB0C34A59628904556F7BEEBC508B&upn=eZNNLsMW3h8&ip=5.249.137.176&ipbits=0&expire=1423440489&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,ms,mv,ratebypass,mime,gir,clen,lmt,dur' [download] Destination: GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f248.webm [download] 100% of 67.51MiB in 00:01 [debug] Invoking downloader on 'https://r19---sn-hpa7enee.googlevideo.com/videoplayback?id=f9d6b62fdc18fab7&itag=141&source=youtube&requiressl=yes&pl=20&mm=31&ms=au&mv=u&ratebypass=yes&mime=audio/mp4&gir=yes&clen=4324017&lmt=1387951441332228&dur=135.604&key=dg_yt0&sver=3&fexp=907263,927622,930676,9405619,9405975,9406817,943917,947225,948124,949429,952302,952605,952612,952901,955301,957201,959701&mt=1423418732&signature=78546D1C5EAA8C1A3156BBD8399CA6104CAE07D5.1755AFC10C792C8593D23A89A78AA00258579395&upn=eZNNLsMW3h8&ip=5.249.137.176&ipbits=0&expire=1423440489&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,ms,mv,ratebypass,mime,gir,clen,lmt,dur' [download] Destination: GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f141.m4a [download] 100% of 4.12MiB in 00:00 [ffmpeg] Merging formats into "GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.webm" [debug] ffmpeg command line: ffmpeg -y -i 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f248.webm' -i 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.f141.m4a' -c copy -map 0:v:0 -map 1:a:0 'GoPro Hero3 Silver Edition 1080p 30fps--da2L9wY-rc.webm' ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1391, in post_process keep_video_wish, info = pp.run(info) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 545, in run self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args) File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 103, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg) FFmpegPostProcessorError Thank you!
Author
Owner

@dstftw commented on GitHub (Feb 8, 2015):

String based format property filtering will be available in the next version. To download mp4 video of the best quality you can specify filter as follows: -f bestvideo[ext=mp4]+bestaudio.

@dstftw commented on GitHub (Feb 8, 2015): String based format property filtering will be available in the next version. To download mp4 video of the best quality you can specify filter as follows: `-f bestvideo[ext=mp4]+bestaudio`.
Author
Owner

@clb92 commented on GitHub (Feb 20, 2015):

String based format property filtering will be available in the next version. To download mp4 video of the best quality you can specify filter as follows: -f bestvideo[ext=mp4]+bestaudio.

I can confirm that this works in current version 2015.02.19.3.

@clb92 commented on GitHub (Feb 20, 2015): > String based format property filtering will be available in the next version. To download mp4 video of the best quality you can specify filter as follows: -f bestvideo[ext=mp4]+bestaudio. I can confirm that this works in current version 2015.02.19.3.
Author
Owner

@vladosfi commented on GitHub (Apr 3, 2015):

I have the same problem and this fix "-f bestvideo[ext=mp4]+bestaudio" doesn't help for version 2015.04.03. On windows 7 64bit system and Youtube-dl create file that can't be deleted!

@vladosfi commented on GitHub (Apr 3, 2015): I have the same problem and this fix "-f bestvideo[ext=mp4]+bestaudio" doesn't help for version 2015.04.03. On windows 7 64bit system and Youtube-dl create file that can't be deleted!
Author
Owner

@dstftw commented on GitHub (Apr 3, 2015):

Try -f bestvideo[ext=mp4]+bestaudio[ext=m4a].

@dstftw commented on GitHub (Apr 3, 2015): Try `-f bestvideo[ext=mp4]+bestaudio[ext=m4a]`.
Author
Owner

@clb92 commented on GitHub (Apr 3, 2015):

Wouldn't the audio format be .m4a?

@clb92 commented on GitHub (Apr 3, 2015): Wouldn't the audio format be .m4a?
Author
Owner

@dstftw commented on GitHub (Apr 3, 2015):

@clb92 yes, correct.

@dstftw commented on GitHub (Apr 3, 2015): @clb92 yes, correct.
Author
Owner

@vladosfi commented on GitHub (Apr 3, 2015):

I've try this right now and still no success!

@vladosfi commented on GitHub (Apr 3, 2015): I've try this right now and still no success!
Author
Owner

@vladosfi commented on GitHub (Apr 4, 2015):

I'm sorry the container format that I specify was not correct. When i use mp4 container there is no problem. But is this option "-f bestvideo[ext=mp4]+bestaudio[ext=m4a]" valid for all clips?

@vladosfi commented on GitHub (Apr 4, 2015): I'm sorry the container format that I specify was not correct. When i use mp4 container there is no problem. But is this option "-f bestvideo[ext=mp4]+bestaudio[ext=m4a]" valid for all clips?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#4034
No description provided.