WordRider Home
Welcome! Log In Create A New Profile

Advanced

Cannot download a specific YouTube video when DASH streams are enabled

Posted by naaloh 
Cannot download a specific YouTube video when DASH streams are enabled
February 02, 2017 04:41PM
In FRD 0.9u4 YouTube.com plugin v 2.9.7 set to "Highest quality", "Any container" and "Enable DASH streams" returns "ERROR - Unable to select YouTube media" and terminates when trying to download the video at https://www.youtube.com/watch?v=BEva2oKKqV8

The video plays in the browser.

The log file is attached.
Attachments:
open | download - app.log (167.1 KB)
Re: Cannot download a specific YouTube video when DASH streams are enabled
February 03, 2017 12:56AM
I can replicate, but only if

Enable internal DASH multiplexer/merger

is also selected in the plugin's options.
If you ask me, this is not a bug but an expected behaviour;
let me explain:

1. AFAIK, the internal DASH multiplexer/merger (pure java code
based on the third party mp4parser library)
is only supposed to support the MP4 media container, yielding
true .mp4 video/audio files.
The MP4 media container, sadly, supports only few combinations
of video+audio elementary streams (e.g. h.264 video codec +
AAC audio codec).
2. When you do not specify a container in the settings,
the "highest quality" DASH video stream (given by the plugin an
erroneous .m4v file extension) can be using any non-MP4
compliant video codec; e.g. in your sample link (when
Enable internal DASH multiplexer/merger
is left unticked) the video-only .m4v file is, as can be inspected by
MediaInfo, a WebM container (a sub-type of the Matroska container)
with the VP9 video codec (2160p30fps).
This video-only DASH stream can't be muxed with the AAC audio-only DASH
stream (.m4a) into a valid MP4 file by the internal merger.

So, if you want to use the internal merger you should specify the MP4 container
and the plugin will pick the compliant streams.
If you don't specify the type of container and don't select the internal merger,
you will find that the plugin does download the separate video+audio streams,
but you'd then have to merge them yourself (better choose the Matroska
container - .mkv file extension - that supports all combinations of codecs) by
employing FFmpeg or even mkvtoolnix.

This is at least my view on how the youtube plugin behaves; I could be totally wrong myself,
but we won't know for sure until tong2shot comes up with the definitive explanation winking smiley

Regards



Edited 1 time(s). Last edit at 02/03/2017 01:21AM by TVjunkie.
Re: Cannot download a specific YouTube video when DASH streams are enabled
February 03, 2017 02:06AM
Thank you for finding this. Unchecking the "Enable internal DASH multiplexer/merger" option does allow to download the m4v and m4a files and the m4v file downloaded that way is indeed a webm file, but it does contain audio track, so there's no need to merge it with the m4a file.

So the problem seems to lie in the plugin treating the webm content as m4v.
Re: Cannot download a specific YouTube video when DASH streams are enabled
February 03, 2017 02:50AM
naaloh wrote:
-------------------------------------------------------
> the m4v file downloaded that way is indeed a webm file,
> but it does contain audio track,
> so there's no need to merge it with the m4a file.

Not true at my end; the video-only DASH file (.m4v file extension), webm container,
only contains a raw VP9 video stream; here's the MediaInfo log:
Format                                   : WebM
Format version                           : Version 4 / Version 2
File size                                : 136 MiB
Duration                                 : 1 min 3 s
Overall bit rate                         : 17.9 Mb/s
Writing application                      : google
Writing library                          : google

Video
ID                                       : 1
Format                                   : VP9
Codec ID                                 : V_VP9
Duration                                 : 1 min 3 s
Bit rate                                 : 17.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Bits/(Pixel*Frame)                       : 0.069
Stream size                              : 131 MiB (96%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
Also, file is indeed mute when played back with latest VLC-3.0.0-nightly

As expected, the audio-only DASH file (.m4a file extension) only contains AAC LC audio stream:
Format                                   : dash
Codec ID                                 : dash (iso6/mp41)
File size                                : 990 KiB
Duration                                 : 1 min 3 s
Overall bit rate                         : 127 kb/s
Encoded date                             : UTC 2017-01-11 21:53:21
Tagged date                              : UTC 2017-01-11 21:53:21

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 1 min 3 s
Bit rate                                 : 126 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 spf)
Compression mode                         : Lossy
Stream size                              : 978 KiB (99%)
Encoded date                             : UTC 2017-01-11 21:53:21
Tagged date                              : UTC 2017-01-11 21:53:21

Muxing them together with FFmpeg is needed and does produce a matroska file with both video+audio:
ffmpeg -v 16 -stats -i foo.m4v -i foo.m4a -c copy -f matroska foo.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 137 MiB
Duration                                 : 1 min 3 s
Overall bit rate                         : 18.0 Mb/s
Writing application                      : Lavf57.25.100
Writing library                          : Lavf57.25.100 / Lavf57.25.100

Video
ID                                       : 1
Format                                   : VP9
Codec ID                                 : V_VP9
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Language                                 : English
Default                                  : Yes
Forced                                   : No
DURATION                                 : 00:01:03.699000000

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : A_AAC
Duration                                 : 1 min 3 s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 spf)
Compression mode                         : Lossy
Default                                  : Yes
Forced                                   : No
DURATION                                 : 00:01:03.785000000
HANDLER_NAME                             : SoundHandler
However, VP9+AAC is an unorthodox combination, since normally VP9 is combined with either vorbis/opus audio codecs...
Re: Cannot download a specific YouTube video when DASH streams are enabled
February 03, 2017 04:43AM
Once again, you're right. Turned out the player I opened the video file with (MPC-HC) took audio from the m4a file of the same name, which at that time was in the same folder. I didn't know the player had that kind of automated functionality, so I assumed the webm did contain an audio track, which it doesn't.
Sorry, only registered users may post in this forum.

Click here to login