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

Having trouble getting the format string to match what I want #9932

Closed
keybounce opened this issue Jun 28, 2016 · 4 comments
Closed

Having trouble getting the format string to match what I want #9932

keybounce opened this issue Jun 28, 2016 · 4 comments

Comments

@keybounce
Copy link

@keybounce keybounce commented Jun 28, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.06.27. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • [ x] I've verified and I assure that I'm running youtube-dl 2016.06.27

Before submitting an issue make sure you have:

  • [ x] At least skimmed through README and most notably FAQ and BUGS sections
  • [ x] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • [ x] Question
  • Other

I am having trouble getting a specific file format.

keybounceMBP:Mlp michael$ youtube-dl -F -v http://www.cbs.com/show/the-late-show-with-stephen-colbert/video/PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j/
the-late-show-6-14-2016-daniel-radcliffe-george-lopez-hinds-/
[debug] System config: []
[debug] User config: [u'--no-mtime', u'-o', u'%(title)s.%(ext)s', u'-f', u'bestvideo[ext=mp4][height=480]+bestaudio[ext=m4a]/bestvideo[ext=mp4][height>360][height<=480]+bestaudio/bestvideo[height<=480]+bestaudio/best[height<=480]/worst', u'--write-sub', u'--embed-subs', u'--recode-video', u'mp4']
[debug] Command-line args: [u'-F', u'-v', u'http://www.cbs.com/shows/the-late-show-with-stephen-colbert/video/PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j/the-late-show-6-14-2016-daniel-radcliffe-george-lopez-hinds-/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.06.27
[debug] Python version 2.7.5 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg N-74965-g26a0cd1-tessus, rtmpdump 2.4
[debug] Proxy map: {}
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading JSON metadata
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading SMIL data for RTMP
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading SMIL data for StreamPack
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading m3u8 information
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading SMIL data for OnceURL
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Checking video URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Downloading m3u8 information
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-1200 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-1200 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-4400 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-4400 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-2000 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-2000 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-764 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-764 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-512 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-512 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-264 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-264 video format URL is invalid, skipping
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: Checking http-60 video format URL
[CBS] 4d2e95d3-7827-431d-b543-af49deee1f5d: http-60 video format URL is invalid, skipping
[CBS] PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j: Downloading JSON metadata
[info] Available formats for PLPg1Zhp1EhPEYMzxXCbP_qQ86wnPS6j:
format code  extension  resolution note
hls-58       mp4        audio only   58k , mp4a.40.2
hls-meta-0   mp4        multiple   Quality selection URL 
hls-meta-1   mp4        multiple   Quality selection URL 
hls-60       mp4        120x68       60k , mp4a.40.5
hls-188      mp4        400x224     188k , avc1.66.30,  mp4a.40.2
hls-264      mp4        256x144     264k , mp4a.40.5, avc1.42001e
hls-333      mp4        400x224     333k , avc1.66.30,  mp4a.40.2
rtmp-364     flv        384x216     364k 
rtmp-496     flv        640x360     496k 
hls-512      mp4        384x216     512k , mp4a.40.5, avc1.42001e
hls-583      mp4        512x288     583k , avc1.66.30,  mp4a.40.2
hls-764      mp4        480x270     764k , mp4a.40.2, avc1.42001e
rtmp-796     flv        640x360     796k 
hls-900      mp4        640x360     900k , avc1.66.30,  mp4a.40.2
hls-1200     mp4        640x360    1200k , mp4a.40.2, avc1.42001f
rtmp-1296    flv        640x360    1296k 
hls-1332     mp4        768x432    1332k , avc1.77.30,  mp4a.40.2
rtmp-1928    flv        848x480    1928k 
hls-1963     mp4        960x540    1963k , avc1.77.30,  mp4a.40.2
hls-2000     mp4        960x540    2000k , mp4a.40.2, avc1.4d001f
hls-2749     mp4        1024x576   2749k , avc1.77.30,  mp4a.40.2
hls-3798     mp4        1280x720   3798k , avc1.77.30,  mp4a.40.2
hls-4400     mp4        1280x720   4400k , mp4a.40.2, avc1.640028 (best)

My format string:
u'-f', u'bestvideo[ext=mp4][height=480]+bestaudio[ext=m4a]/bestvideo[ext=mp4][height>360][height<=480]+bestaudio/bestvideo[height<=480]+bestaudio/best[height<=480]/worst',

Breaking that down:
bestvideo[ext=mp4][height=480]+bestaudio[ext=m4a]
bestvideo[ext=mp4][height>360][height<=480]+bestaudio
bestvideo[height<=480]+bestaudio
best[height<=480]
worst

The goal here:

  1. If there is a 480p mp4, take that.
  2. If not, then if there is an mp4 better than 360, take that.
  3. Otherwise, since conversion will be needed, take the best up to 480.

This CBS recording of Stephen Colbert has these two formats:
hls-1332 mp4 768x432 1332k , avc1.77.30, mp4a.40.2
rtmp-1928 flv 848x480 1928k

I want that hls-1332
I get the rtmp-1928

The flv to mp4 conversion is time consuming, noisy (maxes my fan), etc. 432p is "good enough".

The separation of best video + bestaudio is needed for dealing with youtube's dash. But here, the 432p should match
bestvideo[ext=mp4][height>360][height<=480]+bestaudio
and it has the best audio already in the track.

keybounceMBP:Mlp michael$ youtube-dl --get-format  http://www.cbs.com/shows/the-late-show-with-stephen-colbert/video/PLPg1Zhp1EhPEYMzxXCbP_qQ8
6wnPS6j/the-late-show-6-14-2016-daniel-radcliffe-george-lopez-hinds-/
rtmp-1928 - 848x480
keybounceMBP:Mlp michael$ 

Unfortunately, it's not working.
I don't know what I'm doing wrong.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 28, 2016

CBS does not provide any bestvideo format thus bestvideo expressions won't match anything falling back to best[height<=480] that correctly matches rtmp-1928 as the best format among formats with height under or equal to 480. Add [ext=mp4] to best if only interested in mp4.

@dstftw dstftw closed this Jun 28, 2016
@keybounce
Copy link
Author

@keybounce keybounce commented Jun 29, 2016

Ok, then 1, I know what to do, and

2: What the heck is "best video" then? I see about 15 different video formats in that list?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 29, 2016

best video means the best video-only (no audio) format. As all formats provided by CBS contain both video and audio, they don't fit the term "best video". Few websites provide such formats, of which YouTube is the most well-known one.

@keybounce
Copy link
Author

@keybounce keybounce commented Jun 29, 2016

Okay, thank you.

@qwerty480 qwerty480 mentioned this issue Aug 31, 2016
4 of 8 tasks complete
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.