ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.56k stars 9.97k forks source link

[YouTube] [SOLVED] 3D/2D 360° videos - now encoded in a new, proprietary & non-standard format #15267

Closed Cyroxchan closed 5 years ago

Cyroxchan commented 6 years ago

Before submitting an issue make sure you have:

What is the purpose of your issue?


Description of your issue, suggested solution and other information

It appears that approx. one week ago, YouTube has changed its encoding algorithms for panoramic 360° 2D/3D videos.

As a producer of such videos, I am familiar with the standard format used by most 360° video players to convert the flat video image into a 360° panorama (in either 2D or 3D). The standard video format is in "equirectangular panorama" projection for 2D, and "over/under equirectangular panorama" projection for 3D 360° videos. A 360° video producer would format their video to one of the above projections, and then use YouTube's "Spatial Media Metadata Injector" tool (found here: https://support.google.com/youtube/answer/6178631?hl=en&ref_topic=2888648) to inject the code needed to inform YouTube that the video being uploaded is a 360° panoramic video.

Approx. one week ago, YouTube has changed their internal encoding processes to convert uploaded 360° videos to a custom proprietary format (no longer equirectangular panorama). This format now makes it completely useless to download the desired 360° for viewing in best possible quality & on offline video players, as no viewer outside of YouTube would recognize the proprietary format. YouTube has also been re-encoding previously uploaded videos to their new proprietary format.

For example, here is a screenshot from a video (found on YouTube at: https://www.youtube.com/watch?v=8DqSh_T20WY -- I downloaded it on 2017-11-07):

before

The above image shows the correct over/under equirectangular panorama projection for a 3D 360° video.

However, as of right now, using youtube-dl to download the video ("youtube-dl https://www.youtube.com/watch?v=8DqSh_T20WY -f 315+171 --merge-output-format mkv"), a screenshot of the video at the same timestamp as above looks like this:

after

I can see three possible reasons for encoding their videos in this new proprietary format:

1) They don't want people downloading these videos for offline viewing -- they want people to view the video on YouTube. This is a pretty obvious reason, however if true, why haven't they encoded all the types of videos available on YouTube into an unviewable mess? Why only 360° videos? Which leads me to reason 2.

2) This new format may be faster for their players to process into a 360° video. This would be a fair reason if true, but it makes life miserable for those of us who enjoy downloading the clips for offline viewing in the player of their choice. However, reason 3 is the most likely:

3) The re-encoded video is designed to put as much resolution as possible in the areas of the video that people are most likely to look at. Some research I read shows that 75% of the time, viewers of 360° videos look in the forward 180° or so of the video and don't really look behind them much. In addition, the equirectangular panorama format gives far too much resolution to the top and bottom of the dome projection, and nowhere near enough to the center. YouTube's new encoding format definitely improves on the standard format -- more real estate given to the front half of the video, and the back and bottom are given significantly less. However, it still doesn't help those of us who want to watch it outside YouTube. To be acceptable, it would essentially require the VR/360° industry to accept YouTube's new format as a standard for watching 360° videos and incorporate it into their players & software. For this to happen, of course, YouTube will need to release the specifications for their new encoding format.

Currently, it appears that there's nothing youtube-dl could do to fix this situation. Thus, this "issue" is a request for new functionality: being able to re-encode the 360° videos from YouTube's new proprietary format back into the standard equirectangular panorama projection that most 360° video players recognize.

Thank you for taking the time to review this issue. Hopefully it leads to improvements in youtube-dl in the future!

Andrei114 commented 5 years ago

Found a solution, thanks to @priteshdesai Two programs that work to download the 360 videos:

  1. Video DownloadHelper, a Firefox addon working as of May 4th, 2018 (it will guide you through installing the native program to run on your machine to handle bigger downloads). Once the addon is installed, just go to Youtube and click the new icon To be sure it works (not certain if this step is required):
  • Go to the URL "about:config" in Firefox and click "I understand the risk"
  • Right click to add a New > String
  • Name it "general.useragent.override"
  • Press enter to leave the contents of the variable blank
  • Delete this field once you're done downloading the 360 videos you need

Download link: https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/

  1. MediaHuman Youtube Downloader It's easier to use, but proprietary, and the trial version only lets you download 20 videos https://www.mediahuman.com/youtube-downloader/

Using Virtual Desktop, I could play the videos and they don't wrap or chop incorrectly, seems these programs are downloading older versions of the YouTube video and they aren't formatted the new way.

THX A LOT! it worked for me :) thx so much!

klo4koandrew commented 5 years ago
  1. MediaHuman Youtube Downloader

It's rly works! Thanks! but 8k videos download only like 4096x4096

ShivajiReddy commented 5 years ago

I don't know how relevant my question in this thread is but I feel this is the only thread on this repo where I can ask this. I have been looking for this on Oculus forums and am surprised that how/ if noone has encountered this issue before.

Here is the issue:

So my question is, is it happening because the video I'm running is downloaded from YouTube and YouTube now has their own proprietary encoding for 360 videos, which cannot be rendered anywhere outside YouTube or its something else?

Any help/reference links would be highly appreciated.