Page 1 of 1

Open Youtube videos.

Posted: 24 Jun 2019 19:26
by dlw1145
Can not open .mp4 videos downloaded from Youtube. W10.
VLC 3.0.7.1 The latest download.

dlw

Re: Open Youtube videos.

Posted: 09 Nov 2019 06:36
by rfrazier
Part 1 of 2 by rfrazier.

Hello, my name is Ron. I'm a newbie to the forum but am a long time user of VLC on multiple platforms including Windows, Linux, and now Raspbian (Raspberry Pi.) What I'm about to describe was done on my Raspberry Pi but I think it's applicable to other OS's. At the bottom, I have some questions I need help with as well. This turned out to be long, but bear with me.

I've set up a new Raspberry Pi 4 to serve as a driver for a video projector so I don't have to lug my laptop around. I learned that VLC could play youtube videos, possibly better than the browser, but have also learned that it usually pulls up a low res video instead of the higher quality.

I've been virtually pulling my hair out trying to find a solution. Well, after hours and hours of searching, I've found one, although it's a bit kludgy.

Maybe some of you developers can figure out how this works under the covers and incorporate it into VLC. Or, maybe some of you can write a script to do this.

I've tried this on VLC 3.0.8 on Raspbian 10 (buster). Procedures should be similar on other systems. I'm using the Chromium 74.0 browser but I doubt that matters.

The following article was quite helpful in putting me onto this procedure.

How to Watch YouTube (above 720p DASH streams) in VLC
https://www.reddit.com/r/youtube/comments/3ijei1/how_to_watch_youtube_above_720p_dash_streams_in/

which mentions this article

YouTube Audio Quality Bitrate Used For 360p, 480p, 720p, 1080p, 1440p, 2160p
(old 2015)
https://www.h3xed.com/web-and-internet/youtube-audio-quality-bitrate-240p-360p-480p-720p-1080p

which mentions a website we'll use below.

The main problem seems to be that many of youtube's videos split the audio and video apart and don't give you a high res audio video link from the basic url.

Well, it turns out that it IS possible to stream hi res video and audio separately and simultaneously in VLC and merge them on playback. You just have to go to some trouble. This is actually harder to type and read than it is to do once you get used to it.

The best way to explain is to show you the procedure. I'm doing this without being signed into youtube, but even so, your results could be different. Also, this uses an external website to analyze youtube videos. This works today but who knows how long it will.

Let's say I go to youtube and search for ragtime piano. Then I filter by HD. This is the url for the list that appears:

https://www.youtube.com/results?search_query=ragtime+piano&sp=EgIgAQ%253D%253D

As an example, I chose the first video to appear as I'm writing this:

ALAN THOMPSON JR. RAGTIME PIANO PERFORMANCE AT DISNEYLAND

and its url is:

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

01) Copy the url from the address bar of your browser for whatever youtube video you choose after opening the individual page for the video.

02) Now go to this website:

YouTube Info Tool
http://www.h3xed.com/blogmedia/youtube-info.php

I'm not running javascript for most sites, so I might not see everything on this site, but it still works. You'll see a blank that says paste youtube url or video id here.

03) Paste the url of the video you selected in the blank and hit enter. In my case, it's what I showed above:

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

continued in part 2.

Re: Open Youtube videos.

Posted: 09 Nov 2019 06:37
by rfrazier
Part 2 of 2 by rfrazier.

This then takes you to a (usually) large table with the specs on all the different video files for this url that you put in.

At the bottom is a list of complete video files with audio. In my example, there is only one of medium quality, so it doesn't help me since I want HD. But, look at the top of the table for more useful info.

In my example, the top line of the table says the file is 1920x1080 and file type video/mp4.

04) Look for a line that says 1920x1080 in the table you're on (or whatever resolution you want) and file type mp4.

Right next to that information is a link that says url.

05) Right click on that url link and click copy link address.

06) Now paste that address somewhere in notepad or a text editor where you can get to it again. You may wish to label it as "video file" or something.

video file

https://r1---sn-nx57ynld.googlevideo.com/videoplayback?expire=1573289667&ei=YyrGXan9GsyTkwaLia7IDw&ip=104.198.12.18&id=o-AIV9u8qS4Y33eIdKKrZMAJyu1gJ9luZMOUvSRcLLifhZ&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-nx57ynld%2Csn-n4v7sne7&ms=au%2Conr&mv=u&mvi=0&pl=20&mime=video%2Fmp4&gir=yes&clen=1122249220&dur=2785.682&lmt=1472981147877352&mt=1573267542&fvip=1&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRAIgWhI7hQZ6z2ZDDVfopdLayUydQ-eSYTVRV55r2Fgf7E8CIHsozZWfGiJ9O4T7sEycsj0YBAq6MSbRmXAQgAi02EoF&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AHylml4wRgIhAO3dcjV3DcIyIgkfWkzo_jGYDcYFkSfGy1El1zNr6JabAiEA7JLZvTCI-nPDrXWMdLFbEKy878zCkzMvTGESjsi0zjw%3D

07) Now go back to the table on the website and look near the bottom for a line with file type audio/mp4. In my case, it's the 4th from the bottom. Copy that link and also paste it somewhere you can get to it. You may wish to label it as "audio file" or something.

audio file

https://r1---sn-nx57ynld.googlevideo.com/videoplayback?expire=1573289667&ei=YyrGXan9GsyTkwaLia7IDw&ip=104.198.12.18&id=o-AIV9u8qS4Y33eIdKKrZMAJyu1gJ9luZMOUvSRcLLifhZ&itag=140&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-nx57ynld%2Csn-n4v7sne7&ms=au%2Conr&mv=u&mvi=0&pl=20&mime=audio%2Fmp4&gir=yes&clen=44244982&dur=2785.744&lmt=1472981291697276&mt=1573267542&fvip=1&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIgCaQvBKErqGIcxn0NkEPQMoAdqYRY2sMb_CUrxglHwcYCIQDZo0a8CZd9WKEuZ31zZYsI2kobD7TOg60EShhmiIcAPQ%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AHylml4wRgIhAO3dcjV3DcIyIgkfWkzo_jGYDcYFkSfGy1El1zNr6JabAiEA7JLZvTCI-nPDrXWMdLFbEKy878zCkzMvTGESjsi0zjw%3D

Now, the fun part, we get to go get VLC to play these simultaneously, hi res video and audio.

08) Go to your text file and copy the video link into your clipboard. Be careful not to copy any extra carriage returns in this very long text string. You may wish to do the highlighting with the keyboard instead of your mouse by pressing shift-down several times then back up one character with shift-left, etc.

09) Go to VLC. Click Media, open network stream, and the network tab if it's not already selected.

10) Click the show more options check box, and the play another media synchronously checkbox.

11) Click in the top blank where it says please enter a network url. Paste your video file link there, even though it's 20 miles long.

12) Go back to your text editor and copy the link for your audio file.

13) Go back to VLC. Click in the blank where it says extra media. Paste the link for your audio file there.

14) That's it! If you've done everything right, you should be done. Click PLAY at the bottom and enjoy your high res youtube video!

WHEW! Documenting that turned out to be lots harder than I thought.

Now, for those of you that are still with me after all that. I need your help to take it to the next level with 4 questions.

A) Is there a way to script this so I can click a link on my desktop to kick off the video instantly once I've set it up?

B) Sometimes there is a delay between the video and the audio of up to about 1/2 second. Is there a way to manually compensate for that? The delay seems to be a bit variable, and was less the 2nd time I played my test video.

C) Is there a way to easily save the combined audio and video from VLC?

D) If you put these hideously long url's into Chromium, you will have an opportunity to download the files. How could you then merge them into one file?

I hope this helps and thank you very much for any help you can give me. This took a while to type so forgive any typos.

Ron

Re: Open Youtube videos.

Posted: 20 Nov 2019 17:48
by adtsolutions
The tool for the link you provided (http://www.h3xed.com/blogmedia/youtube-info.php) appears to no longer be working...:(

Re: Open Youtube videos.

Posted: 20 Nov 2019 22:43
by rfrazier
(typing on touch screen. forgive capitalization.) that's a bummer. don't know why. just looked up a ragtime piano link on YT and filtered by HD. tried to stream that in vlc and got a 360p version. then searched for hd video test and picked one with nature scenes. vlc streamed that at 720p h.264. i don't know what controls what you get. but, if you get a good quality video, you can do view, advanced controls, and click the record button to save it. anybody that knows a better way let us know.

Ron