QMPlay2 icon indicating copy to clipboard operation
QMPlay2 copied to clipboard

YT video doesn't open, downloads with yt_dlp

Open RJVB opened this issue 2 years ago • 4 comments

https://www.youtube.com/watch?v=fbCK297tylw

QMplay2 fails to open the video apparently because it isn't designed to accept a higher resolution if a preferred lower resolution isn't available.

yt_dlp downloaded the link as a 30Hz 1080p VP9 video but curiously QMPlay2 still fails play the link if I request 1080p, or even if I just ask for the maximum supported quality (all at VP9).

[25 Jan 2024 14:58:45.796] YouTube :: Can't find desired format, available: (231, 95, 232, 96, 233, 234, 269, 270, 91, 92, 229, 93, 230, 94)
[25 Jan 2024 14:58:45.799] Cannot open: YouTube://{https://www.youtube.com/watch?v=fbCK297tylw}

RJVB avatar Jan 25 '24 14:01 RJVB

This video plays at 1080p 30 FPS H.264. What should I set to fail?

zaps166 avatar Jan 25 '24 19:01 zaps166

This video plays at 1080p 30 FPS H.264.

It also plays at 720p, H264, indeed.

What should I set to fail?

The thing is that the settings for codec and quality are both "preferred". I thought that your algorithm already falls back to H264 if VP9 isn't available but maybe that's only the case when there are no VP9 streams at all?

In this case I'd argue that (in absence of counter instructions) precedence should be given to the user-selected preferred maximum resolution which I think more likely to correspond to hardware limitations than the preferred codec.

So, if a video has streams in the preferred high-quality codec but only in a superior resolution

  • fall back to a lower-quality codec if a stream exists with that codec and the preferred resolution
  • find the nearest higher resolution in the preferred codec otherwise.

But I realise that users who have HW-accelerated VP9 decoding might not agree with that priority and at some point we'll probably also have to deal with prioritising the 3 supported codecs.

An alternative for this situation where QMPlay2 can't make a choice would be to pop up a list with all existing codec/resolution pairs and let the user pick one. It isn't very elegant to let the user believe something is wrong with the video (or that YT have started cracking down on our "stealing" their ad income) while really the problem is just that the automatic selection of the most appropriate video stream fails.

RJVB avatar Jan 25 '24 21:01 RJVB

Please check this function: https://github.com/zaps166/QMPlay2/blob/be34a2164b8e688928b32ee2dbfc462a9d151841/src/modules/Extensions/YouTube.cpp#L791 Here are all supported formats within presets and primary codec.

zaps166 avatar Jan 25 '24 23:01 zaps166

src/modules/Extensions/YouTube.cpp#L791

I suppose I should look at the block starting at line 802, to know in what order you handle format fallbacks?

Here's the format list as I get it today, which I have trouble reading btw (where's the 1080p VP9 stream I downloaded yesterday, for instance) :

> yt_dlp -F "https://www.youtube.com/watch?v=fbCK297tylw"
[youtube] Extracting URL: https://www.youtube.com/watch?v=fbCK297tylw
[youtube] fbCK297tylw: Downloading webpage
[youtube] fbCK297tylw: Downloading ios player API JSON
[youtube] fbCK297tylw: Downloading android player API JSON
[youtube] fbCK297tylw: Downloading m3u8 information
[info] Available formats for fbCK297tylw:
ID  EXT   RESOLUTION FPS CH │   FILESIZE   TBR PROTO │ VCODEC          VBR ACODEC      ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3 mhtml 48x27        0    │                  mhtml │ images                                  storyboard
sb2 mhtml 80x45        0    │                  mhtml │ images                                  storyboard
sb1 mhtml 160x90       0    │                  mhtml │ images                                  storyboard
sb0 mhtml 320x180      0    │                  mhtml │ images                                  storyboard
233 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
234 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
139 m4a   audio only      2 │   29.60MiB   49k https │ audio only          mp4a.40.5   49k 22k [en] low, m4a_dash
140 m4a   audio only      2 │   78.56MiB  129k https │ audio only          mp4a.40.2  129k 44k [en] medium, m4a_dash
251 webm  audio only      2 │   69.89MiB  115k https │ audio only          opus       115k 48k [en] medium, webm_dash
269 mp4   256x144     30    │ ~106.80MiB  172k m3u8  │ avc1.4D400C    172k video only
160 mp4   256x144     30    │   35.69MiB   59k https │ avc1.4D400C     59k video only          144p, mp4_dash
230 mp4   640x360     30    │ ~408.27MiB  657k m3u8  │ avc1.4D401E    657k video only
134 mp4   640x360     30    │  157.59MiB  260k https │ avc1.4D401E    260k video only          360p, mp4_dash
18  mp4   640x360     30  2 │  215.05MiB  354k https │ avc1.42001E         mp4a.40.2       44k [en] 360p
605 mp4   640x360     30    │ ~328.56MiB  529k m3u8  │ vp09.00.21.08  529k video only
22  mp4   1280x720    30  2 │ ≈681.93MiB 1098k https │ avc1.64001F         mp4a.40.2       44k [en] 720p
232 mp4   1280x720    30    │ ~  1.19GiB 1967k m3u8  │ avc1.64001F   1967k video only
136 mp4   1280x720    30    │  588.10MiB  969k https │ avc1.64001F    969k video only          720p, mp4_dash
270 mp4   1920x1080   30    │ ~  2.12GiB 3498k m3u8  │ avc1.640028   3498k video only
137 mp4   1920x1080   30    │    1.03GiB 1743k https │ avc1.640028   1743k video only          1080p, mp4_dash

I didn't restart QMPlay2 after checking your latest commit but today the video starts just fine, giving me 720p30 H264 instead of the preferred VP9 720p60. I was going to ask if you already changed something but I shouldn't be seeing the effects of that until I relaunch the app (unless you have a clever module reloading algorithm?). Is it possible YT changed something?

RJVB avatar Jan 26 '24 11:01 RJVB

"Funny", another video on the same channel that (currently) doesn't open when I leave the preferred codec set to VP9 (and 720p60) but does when I switch to H264:

https://www.youtube.com/watch?v=phKr6wEA3dk

RJVB avatar Feb 22 '24 12:02 RJVB

"Funny", another video on the same channel that (currently) doesn't open when I leave the preferred codec set to VP9 (and 720p60) but does when I switch to H264: https://www.youtube.com/watch?v=phKr6wEA3dk

This video plays when I select VP9 720p60 preset. QMPlay2 automatically uses H.264 codec.

zaps166 avatar Feb 22 '24 17:02 zaps166

On Thursday February 22 2024 09:05:18 Błażej Szczygieł wrote:

This video plays when I select VP9 720p60 preset. QMPlay2 automatically uses H.264 codec.

It does for too now ... the "currently" was already no longer valid ... :-/

RJVB avatar Feb 22 '24 17:02 RJVB

@RJVB Oh, since you are here, maybe you could take a look at fixing/improving our Qt4 version?

Video playback works fine, but YouTube or anything from the web does not: https://github.com/zaps166/QMPlay2/issues/674

barracuda156 avatar Mar 18 '24 18:03 barracuda156

Video playback works fine, but YouTube or anything from the web does not: https://github.com/zaps166/QMPlay2/issues/674

I wasn't even aware that there was still Qt4 support but I'll see if I can find some time to have a look. I'm not at all familiar with the networking code though, and the videos I stream myself are almost certainly being fetched, reassembled, demuxed etc. by FFmpeg.

To get back to the original issue: it is clear now that the videos in this channel get their H264 version after the VP9 version (or maybe even "on demand", after someone requested it?).

RJVB avatar Mar 18 '24 20:03 RJVB

Got another one...

https://www.youtube.com/watch?v=MrXefLhFn78

> yt_dlp -F "https://www.youtube.com/watch?v=MrXefLhFn78"
[youtube] Extracting URL: https://www.youtube.com/watch?v=MrXefLhFn78
[youtube] MrXefLhFn78: Downloading webpage
[youtube] MrXefLhFn78: Downloading ios player API JSON
[youtube] MrXefLhFn78: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "MrXefLhFn78")
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading MPD manifest
[info] Available formats for MrXefLhFn78:
ID  EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
233 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
234 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
139 m4a  audio only     │ ~ 36.05MiB   64k dash  │ audio only        mp4a.40.5   64k 22k DASH audio, m4a_dash
140 m4a  audio only     │ ~ 81.12MiB  144k dash  │ audio only        mp4a.40.2  144k 44k DASH audio, m4a_dash
160 mp4  256x144     15 │ ~119.69MiB  212k dash  │ avc1.42c00b  212k video only          DASH video, mp4_dash
269 mp4  256x144     15 │ ~163.54MiB  290k m3u8  │ avc1.42C00B  290k video only
91  mp4  256x144     15 │ ~163.54MiB  290k m3u8  │ avc1.42c00b       mp4a.40.5
278 webm 256x144     30 │ ~ 62.53MiB  111k dash  │ vp9          111k video only          DASH video, webm_dash
133 mp4  426x240     30 │ ~257.02MiB  456k dash  │ avc1.4d4015  456k video only          DASH video, mp4_dash
229 mp4  426x240     30 │ ~307.73MiB  546k m3u8  │ avc1.4D4015  546k video only
92  mp4  426x240     30 │ ~307.73MiB  546k m3u8  │ avc1.4d4015       mp4a.40.5
242 webm 426x240     30 │ ~ 68.17MiB  121k dash  │ vp9          121k video only          DASH video, webm_dash
134 mp4  640x360     30 │ ~568.00MiB 1008k dash  │ avc1.4d401e 1008k video only          DASH video, mp4_dash
230 mp4  640x360     30 │ ~681.58MiB 1210k m3u8  │ avc1.4D401E 1210k video only
93  mp4  640x360     30 │ ~681.58MiB 1210k m3u8  │ avc1.4d401e       mp4a.40.2
243 webm 640x360     30 │ ~133.40MiB  237k dash  │ vp9          237k video only          DASH video, webm_dash
135 mp4  854x480     30 │ ~760.54MiB 1350k dash  │ avc1.4d401f 1350k video only          DASH video, mp4_dash
231 mp4  854x480     30 │ ~883.75MiB 1569k m3u8  │ avc1.4D401F 1569k video only
94  mp4  854x480     30 │ ~883.75MiB 1569k m3u8  │ avc1.4d401f       mp4a.40.2
244 webm 854x480     30 │ ~297.45MiB  528k dash  │ vp9          528k video only          DASH video, webm_dash
136 mp4  1280x720    30 │ ~  1.48GiB 2684k dash  │ avc1.4d401f 2684k video only          DASH video, mp4_dash
232 mp4  1280x720    30 │ ~  1.63GiB 2969k m3u8  │ avc1.4D401F 2969k video only
95  mp4  1280x720    30 │ ~  1.63GiB 2969k m3u8  │ avc1.4d401f       mp4a.40.2
247 webm 1280x720    30 │ ~412.83MiB  733k dash  │ vp9          733k video only          DASH video, webm_dash
137 mp4  1920x1080   30 │ ~  2.76GiB 5019k dash  │ avc1.640028 5019k video only          DASH video, mp4_dash
270 mp4  1920x1080   30 │ ~  2.98GiB 5421k m3u8  │ avc1.640028 5421k video only
96  mp4  1920x1080   30 │ ~  2.98GiB 5421k m3u8  │ avc1.640028       mp4a.40.2
248 webm 1920x1080   30 │ ~  1.59GiB 2896k dash  │ vp9         2896k video only          DASH video, webm_dash

In QMPlay2 (git/HEAD):

[04 avr. 2024 13:10:30.938] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:10:59.976] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:10:59.978] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:11:39.456] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:11:39.458] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:12:09.084] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:12:09.087] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:15:20.935] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:15:20.938] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:17:03.175] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:17:03.177] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:17:23.447] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:17:23.450] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:17:55.158] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:17:55.160] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:18:21.182] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:18:21.184] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:19:34.381] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:19:34.383] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}
[04 avr. 2024 13:19:53.511] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)
[04 avr. 2024 13:19:53.513] Cannot open: YouTube://{https://www.youtube.com/watch?v=MrXefLhFn78}audio
[04 avr. 2024 13:20:28.135] YouTube :: Can't find desired format, available: (91, 230, 94, 231, 95, 92, 229, 93, 234, 270, 232, 96, 233, 269)

I've tried just about every codec/resolution combination of 1080p and below.

The website gives me this:

image

Edit:

> yt_dlp -f 135+140 "https://www.youtube.com/watch?v=MrXefLhFn78"[youtube] Extracting URL: https://www.youtube.com/watch?v=MrXefLhFn78
[youtube] MrXefLhFn78: Downloading webpage
[youtube] MrXefLhFn78: Downloading ios player API JSON
[youtube] MrXefLhFn78: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "MrXefLhFn78")
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading MPD manifest
[info] MrXefLhFn78: Downloading 1 format(s): 135+140
[dashsegments] Total fragments: 925
[download] Destination: Frank Vignola's Guitar Night, with Nicole Zuraitis and Warren Vaché, April 3, 2024 [MrXefLhFn78].f135.mp4
[download]  30.9% of ~ 147.29MiB at  700.59KiB/s ETA 02:36 (frag 287/925)

(this is using the yt_dlp copy from the QMPlay2 folder)

RJVB avatar Apr 04 '24 11:04 RJVB

I just notice that the audio is 44.1kHz MP4, not the 48kHz Ogg I'm used to getting - and there appear to be only MP4 audio streams. Could that be the reason QMPlay2 refuses to open the video?

RJVB avatar Apr 04 '24 11:04 RJVB

Got another one...

https://www.youtube.com/watch?v=MrXefLhFn78

(sorted so formats appear in the same order as in the later format list)

> yt_dlp -F "https://www.youtube.com/watch?v=MrXefLhFn78"
[youtube] Extracting URL: https://www.youtube.com/watch?v=MrXefLhFn78
[youtube] MrXefLhFn78: Downloading webpage
[youtube] MrXefLhFn78: Downloading ios player API JSON
[youtube] MrXefLhFn78: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "MrXefLhFn78")
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading m3u8 information
[youtube] MrXefLhFn78: Downloading MPD manifest
[info] Available formats for MrXefLhFn78:
ID  EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
233 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
234 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
139 m4a  audio only     │ ~ 36.05MiB   64k dash  │ audio only        mp4a.40.5   64k 22k DASH audio, m4a_dash
140 m4a  audio only     │ ~ 81.12MiB  144k dash  │ audio only        mp4a.40.2  144k 44k DASH audio, m4a_dash
269 mp4  256x144     15 │ ~163.54MiB  290k m3u8  │ avc1.42C00B  290k video only
160 mp4  256x144     15 │ ~119.69MiB  212k dash  │ avc1.42c00b  212k video only          DASH video, mp4_dash
278 webm 256x144     30 │ ~ 62.53MiB  111k dash  │ vp9          111k video only          DASH video, webm_dash
133 mp4  426x240     30 │ ~257.02MiB  456k dash  │ avc1.4d4015  456k video only          DASH video, mp4_dash
229 mp4  426x240     30 │ ~307.73MiB  546k m3u8  │ avc1.4D4015  546k video only
242 webm 426x240     30 │ ~ 68.17MiB  121k dash  │ vp9          121k video only          DASH video, webm_dash
230 mp4  640x360     30 │ ~681.58MiB 1210k m3u8  │ avc1.4D401E 1210k video only
134 mp4  640x360     30 │ ~568.00MiB 1008k dash  │ avc1.4d401e 1008k video only          DASH video, mp4_dash
243 webm 640x360     30 │ ~133.40MiB  237k dash  │ vp9          237k video only          DASH video, webm_dash
135 mp4  854x480     30 │ ~760.54MiB 1350k dash  │ avc1.4d401f 1350k video only          DASH video, mp4_dash
231 mp4  854x480     30 │ ~883.75MiB 1569k m3u8  │ avc1.4D401F 1569k video only
244 webm 854x480     30 │ ~297.45MiB  528k dash  │ vp9          528k video only          DASH video, webm_dash
232 mp4  1280x720    30 │ ~  1.63GiB 2969k m3u8  │ avc1.4D401F 2969k video only
136 mp4  1280x720    30 │ ~  1.48GiB 2684k dash  │ avc1.4d401f 2684k video only          DASH video, mp4_dash
247 webm 1280x720    30 │ ~412.83MiB  733k dash  │ vp9          733k video only          DASH video, webm_dash
270 mp4  1920x1080   30 │ ~  2.98GiB 5421k m3u8  │ avc1.640028 5421k video only
137 mp4  1920x1080   30 │ ~  2.76GiB 5019k dash  │ avc1.640028 5019k video only          DASH video, mp4_dash
248 webm 1920x1080   30 │ ~  1.59GiB 2896k dash  │ vp9         2896k video only          DASH video, webm_dash
91  mp4  256x144     15 │ ~163.54MiB  290k m3u8  │ avc1.42c00b       mp4a.40.5
92  mp4  426x240     30 │ ~307.73MiB  546k m3u8  │ avc1.4d4015       mp4a.40.5
93  mp4  640x360     30 │ ~681.58MiB 1210k m3u8  │ avc1.4d401e       mp4a.40.2
94  mp4  854x480     30 │ ~883.75MiB 1569k m3u8  │ avc1.4d401f       mp4a.40.2
95  mp4  1280x720    30 │ ~  1.63GiB 2969k m3u8  │ avc1.4d401f       mp4a.40.2
96  mp4  1920x1080   30 │ ~  2.98GiB 5421k m3u8  │ avc1.640028       mp4a.40.2

And 1 day later the video plays because its "offering" has changed considerably:

> yt_dlp -F "https://www.youtube.com/watch?v=MrXefLhFn78"
[youtube] Extracting URL: https://www.youtube.com/watch?v=MrXefLhFn78
[youtube] MrXefLhFn78: Downloading webpage
[youtube] MrXefLhFn78: Downloading ios player API JSON
[youtube] MrXefLhFn78: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "MrXefLhFn78")
[youtube] MrXefLhFn78: Downloading m3u8 information
[info] Available formats for MrXefLhFn78:
ID  EXT   RESOLUTION FPS CH │   FILESIZE   TBR PROTO │ VCODEC          VBR ACODEC      ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3 mhtml 48x27        0    │                  mhtml │ images                                  storyboard
sb2 mhtml 80x45        0    │                  mhtml │ images                                  storyboard
sb1 mhtml 160x90       0    │                  mhtml │ images                                  storyboard
sb0 mhtml 320x180      0    │                  mhtml │ images                                  storyboard
233 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
234 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
139 m4a   audio only      2 │   26.90MiB   49k https │ audio only          mp4a.40.5   49k 22k [en] low, m4a_dash
140 m4a   audio only      2 │   71.38MiB  129k https │ audio only          mp4a.40.2  129k 44k [en] medium, m4a_dash
251 webm  audio only      2 │   73.53MiB  133k https │ audio only          opus       133k 48k [en] medium, webm_dash
269 mp4   256x144     30    │ ~102.29MiB  181k m3u8  │ avc1.4D400C    181k video only
160 mp4   256x144     30    │   36.69MiB   67k https │ avc1.4D400C     67k video only          144p, mp4_dash
230 mp4   640x360     30    │ ~470.46MiB  833k m3u8  │ avc1.4D401E    833k video only
134 mp4   640x360     30    │  179.65MiB  326k https │ avc1.4D401E    326k video only          360p, mp4_dash
18  mp4   640x360     30  2 │  230.09MiB  417k https │ avc1.42001E         mp4a.40.2       44k [en] 360p
605 mp4   640x360     30    │ ~308.06MiB  546k m3u8  │ vp09.00.21.08  546k video only
232 mp4   1280x720    30    │ ~  1.50GiB 2718k m3u8  │ avc1.64001F   2718k video only
136 mp4   1280x720    30    │  676.91MiB 1228k https │ avc1.64001F   1228k video only          720p, mp4_dash
270 mp4   1920x1080   30    │ ~  2.83GiB 5133k m3u8  │ avc1.640028   5133k video only
137 mp4   1920x1080   30    │    1.25GiB 2323k https │ avc1.640028   2323k video only          1080p, mp4_dash

RJVB avatar Apr 05 '24 12:04 RJVB

I'm going to see if this change makes a difference, but that won't be possible before next week when the next Guitar Night will have taken place...

diff --git a/src/modules/Extensions/YouTube.cpp b/src/modules/Extensions/YouTube.cpp
index a4fe17cf99f278524476def4bd91f62cabd815d9..65af9f2d8c7bad3156446fe9e85979340a19e494 100644
--- a/src/modules/Extensions/YouTube.cpp
+++ b/src/modules/Extensions/YouTube.cpp
@@ -1278,6 +1278,13 @@ QStringList YouTube::getYouTubeVideo(const QString &param, const QString &url, I
             exts.clear();
         }
     }
+    // RJVB
+    if (!isLive && urls.isEmpty())
+    {
+        // no luck, let's see if any of the supported "live" formats are available
+        // (and this content started life as a live stream?)
+        appendUrl(hlsItags);
+    }
 
     if (urls.isEmpty())
     {

RJVB avatar Apr 05 '24 12:04 RJVB

This link works to me correctly :astonished:

zaps166 avatar Apr 05 '24 19:04 zaps166

@RJVB You can create PR with this diff.

zaps166 avatar Apr 05 '24 19:04 zaps166

This link works to me correctly 😲

That's the thing: this is a temporary situation so the link also works for me. It's a pity you didn't get to jump on my posts from yesterday to see if the linked played for you back then!

I have been suspecting that it is something related to content that started as a live stream being converted to its permanent form. Now that I've seen the code it looks like you would indeed be treating live streams differently if they're no longer listed as such.

I'll create a PR once I've been able to test the change. But suppose it works, would there be any reason to continue to treat life streams differently, rather than just adding their formats at the end like I'm doing now? I cannot assess to what extent the few formats added if the content is not a life stream (audio-only IIRC) would change anything if the stream is a live one and the corresponding formats get listed after rather than instead of those few other formats.

RJVB avatar Apr 05 '24 19:04 RJVB

I see. I think this patch looks good and can go anyway. I'll release soon due to issues with taglib on Windows.

zaps166 avatar Apr 06 '24 19:04 zaps166

That's all I can do now, I hope it'll work!

zaps166 avatar Apr 06 '24 20:04 zaps166

That's all I can do now, I hope it'll work!

Thanks for just including it ... if it doesn't work I'll be sure to experiment more. Normally that'd be next Thursday.

RJVB avatar Apr 06 '24 21:04 RJVB

FWIW, the link for the next one has already been created, in case anyone else wants to look into this:

https://www.youtube.com/watch?v=qZWAtSmrnec

(live stream starts in about 5h)

RJVB avatar Apr 10 '24 19:04 RJVB

So..

Here's what I current see in terms of available formats:

> yt_dlp  -F "https://www.youtube.com/watch?v=qZWAtSmrnec"
[youtube] Extracting URL: https://www.youtube.com/watch?v=qZWAtSmrnec
[youtube] qZWAtSmrnec: Downloading webpage
[youtube] qZWAtSmrnec: Downloading ios player API JSON
[youtube] qZWAtSmrnec: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "qZWAtSmrnec")
[youtube] qZWAtSmrnec: Downloading m3u8 information
[youtube] qZWAtSmrnec: Downloading m3u8 information
[youtube] qZWAtSmrnec: Downloading MPD manifest
[info] Available formats for qZWAtSmrnec:
ID  EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
233 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
234 mp4  audio only     │                  m3u8  │ audio only        unknown             Default
139 m4a  audio only     │ ~ 40.15MiB   64k dash  │ audio only        mp4a.40.5   64k 22k DASH audio, m4a_dash
140 m4a  audio only     │ ~ 90.33MiB  144k dash  │ audio only        mp4a.40.2  144k 44k DASH audio, m4a_dash
160 mp4  256x144     15 │ ~133.28MiB  212k dash  │ avc1.42c00b  212k video only          DASH video, mp4_dash
269 mp4  256x144     15 │ ~182.10MiB  290k m3u8  │ avc1.42C00B  290k video only
91  mp4  256x144     15 │ ~182.10MiB  290k m3u8  │ avc1.42c00b       mp4a.40.5
278 webm 256x144     30 │ ~ 69.63MiB  111k dash  │ vp9          111k video only          DASH video, webm_dash
133 mp4  426x240     30 │ ~286.20MiB  456k dash  │ avc1.4d4015  456k video only          DASH video, mp4_dash
229 mp4  426x240     30 │ ~342.67MiB  546k m3u8  │ avc1.4D4015  546k video only
92  mp4  426x240     30 │ ~342.67MiB  546k m3u8  │ avc1.4d4015       mp4a.40.5
242 webm 426x240     30 │ ~ 75.91MiB  121k dash  │ vp9          121k video only          DASH video, webm_dash
134 mp4  640x360     30 │ ~632.49MiB 1008k dash  │ avc1.4d401e 1008k video only          DASH video, mp4_dash
230 mp4  640x360     30 │ ~758.97MiB 1210k m3u8  │ avc1.4D401E 1210k video only
93  mp4  640x360     30 │ ~758.97MiB 1210k m3u8  │ avc1.4d401e       mp4a.40.2
243 webm 640x360     30 │ ~148.55MiB  237k dash  │ vp9          237k video only          DASH video, webm_dash
135 mp4  854x480     30 │ ~846.90MiB 1350k dash  │ avc1.4d401f 1350k video only          DASH video, mp4_dash
231 mp4  854x480     30 │ ~984.09MiB 1569k m3u8  │ avc1.4D401F 1569k video only
94  mp4  854x480     30 │ ~984.09MiB 1569k m3u8  │ avc1.4d401f       mp4a.40.2
244 webm 854x480     30 │ ~331.22MiB  528k dash  │ vp9          528k video only          DASH video, webm_dash
136 mp4  1280x720    30 │ ~  1.64GiB 2684k dash  │ avc1.4d401f 2684k video only          DASH video, mp4_dash
232 mp4  1280x720    30 │ ~  1.82GiB 2969k m3u8  │ avc1.4D401F 2969k video only
95  mp4  1280x720    30 │ ~  1.82GiB 2969k m3u8  │ avc1.4d401f       mp4a.40.2
247 webm 1280x720    30 │ ~459.70MiB  733k dash  │ vp9          733k video only          DASH video, webm_dash
137 mp4  1920x1080   30 │ ~  3.07GiB 5019k dash  │ avc1.640028 5019k video only          DASH video, mp4_dash
270 mp4  1920x1080   30 │ ~  3.32GiB 5421k m3u8  │ avc1.640028 5421k video only
96  mp4  1920x1080   30 │ ~  3.32GiB 5421k m3u8  │ avc1.640028       mp4a.40.2
248 webm 1920x1080   30 │ ~  1.77GiB 2896k dash  │ vp9         2896k video only          DASH video, webm_dash

Launching shows this in QMplay2: image

For comparison, with last week's stream I get this: image

(my preferred format is set to VP9/720p60.)

Looks like my patch worked!

RJVB avatar Apr 11 '24 12:04 RJVB