Bug 212361 - [GStreamer] Mobile YouTube does not play in browser
Summary: [GStreamer] Mobile YouTube does not play in browser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL: https://gitlab.gnome.org/GNOME/epipha...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-25 13:37 PDT by Alex R
Modified: 2020-05-28 13:37 PDT (History)
5 users (show)

See Also:


Attachments
console output from running epiphany from command line (801 bytes, text/plain)
2020-05-26 12:16 PDT, Alex R
no flags Details
gst log filled up! (36.52 KB, text/plain)
2020-05-26 14:21 PDT, Alex R
no flags Details
gst-inspect output as requested (31.21 KB, text/plain)
2020-05-26 14:26 PDT, Alex R
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex R 2020-05-25 13:37:26 PDT
Videos from https://m.youtube.com do not play in browser.

Bug: If you click on YouTube video, you see RTSP URL and unable to display error.

Expected outcome: Video playback occurs

Hardware: PinePhone Braveheart edition

Software: PureOS (Debian buster derivative)
Comment 1 Michael Catanzaro 2020-05-25 14:22:57 PDT
Questions for multimedia devs: (a) do we support RTSP? and (b) is it supposed to be a main resource URI? (If it's intended to be used as the main resource, then we have to whitelist it in Epiphany as as a web scheme. If it's not intended to be used as a main resource, then it'd be good to figure out why it's happening.)

(In reply to Alex R from comment #0)
> Videos from https://m.youtube.com do not play in browser.

How do you get to m.youtube.com without it redirecting you to the desktop website? Even if I shrink Epiphany down to mobile size and toggle the hidden mobile user agent setting, it still redirects me to desktop YouTube. We need clear instructions in order to reproduce the issue.
Comment 2 Alex R 2020-05-25 14:43:41 PDT
try this?

gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ user-agent "Mozilla/5.0 (Linux; Android 8.0.0; XT1635-02) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36"
Comment 3 Alex R 2020-05-25 14:44:11 PDT
> How do you get to m.youtube.com without it redirecting you to the desktop
> website? Even if I shrink Epiphany down to mobile size and toggle the hidden
> mobile user agent setting, it still redirects me to desktop YouTube. We need
> clear instructions in order to reproduce the issue.

try this:

gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ user-agent "Mozilla/5.0 (Linux; Android 8.0.0; XT1635-02) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36"
Comment 4 Philippe Normand 2020-05-26 00:58:24 PDT
I can't reproduce this with MiniBrowser from trunk. Here videos from m.yt.com play fine with the MSE backend, no RTSP involved.

Please provide a log file... GST_DEBUG="3,webkit*:6" GST_DEBUG_FILE="gst.log" epiphony.... Then compress gst.log and attach it here.
Comment 5 Michael Catanzaro 2020-05-26 11:12:31 PDT
(In reply to Alex R from comment #3)
> try this:
> 
> gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ user-agent
> "Mozilla/5.0 (Linux; Android 8.0.0; XT1635-02) AppleWebKit/537.36 (KHTML,
> like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36"

This does allow me to access mobile YouTube. But, like Phil, the videos play perfectly fine for me.
Comment 6 Alex R 2020-05-26 12:16:51 PDT
Created attachment 400266 [details]
console output from running epiphany from command line
Comment 7 Alex R 2020-05-26 12:18:06 PDT
it looks like the Gdk-WARNING line shows up when the youtube video tries to open and bug appears. i couldn't get the GST_DEBUG_FILE to work. please send further instructions on that if necessary.
Comment 8 Philippe Normand 2020-05-26 12:30:59 PDT
(In reply to Alex R from comment #7)
> it looks like the Gdk-WARNING line shows up when the youtube video tries to
> open and bug appears.

I doubt this is related with the issue you're having.

> i couldn't get the GST_DEBUG_FILE to work. please send
> further instructions on that if necessary.

I don't have further instructions. What makes you say this didn't work?

Anyway, this looks like an issue with your OS and availability of GStreamer plugins. My guess is that some elements are missing (decoders, demuxers) which trick decoding errors in the player and YT falls back to RTSP, for some reason. Without debug log I can't say. So if you can't provide a debug log, I'll have to close this bug as WORKSFORME. :(
Comment 9 Alex R 2020-05-26 13:18:37 PDT
I did this: 

GST_DEBUG="3,webkit*:6" GST_DEBUG_FILE=/home/purism/gst.log GST_DEBUG_DUMP_DOT_DIR=/home/purism epiphany

and managed to get this in the gst log:

0:00:00.052245439  3001 0xaaaae9f4ff50 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "fdkaacdec"!



Hope it helps.
Comment 10 Philippe Normand 2020-05-26 13:25:35 PDT
The log contains only one line?
Comment 11 Alex R 2020-05-26 13:29:23 PDT
yes
Comment 12 Philippe Normand 2020-05-26 13:41:10 PDT
This doesn't make sense... How many tests pass on this page? https://w3c-test.org/media-source/mediasource-is-type-supported.html
Comment 13 Alex R 2020-05-26 13:48:59 PDT
Harness status: OK

Found 47 tests

25 Pass
22 Fail
Comment 14 Philippe Normand 2020-05-26 13:52:16 PDT
Which ones fails?

Anyway this doesn't explain the almost-empty log. Seems like your OS disabled gst debug log support perhaps?
Comment 15 Michael Catanzaro 2020-05-26 14:11:15 PDT
(In reply to Alex R from comment #9)
> 0:00:00.052245439  3001 0xaaaae9f4ff50 WARN     GST_ELEMENT_FACTORY
> gstelementfactory.c:456:gst_element_factory_make: no such element factory
> "fdkaacdec"!

I think you're missing gst-plugins-bad?
Comment 16 Philippe Normand 2020-05-26 14:11:37 PDT
Please share the output of `gst-inspect-1.0` too.
Comment 17 Alex R 2020-05-26 14:19:25 PDT
(In reply to Philippe Normand from comment #14)
> Which ones fails?
> 
> Anyway this doesn't explain the almost-empty log. Seems like your OS
> disabled gst debug log support perhaps?

Test invalid MIME format "video/webm"
assert_equals: supported expected false but got true

Test invalid MIME format "video/webm;codecs"
assert_equals: supported expected false but got true

Test invalid MIME format "video/webm;codecs="
assert_equals: supported expected false but got true

Test invalid MIME format "video/webm;codecs="""
assert_equals: supported expected false but got true

Test invalid MIME format "audio/webm;aaacodecsbbb="
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/webm;codecs="vp8""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/webm;codecs="vorbis""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/webm;codecs="mp4a 40.2""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"video/webm;codecs="mp4a 40.2""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/mp4;codecs="mp4a""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/mp4;codecs="mp4a.40""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/mp4;codecs="mp4a.40.""
assert_equals: supported expected false but got true

Test invalid mismatch between MIME type and codec ID
"audio/mp4;codecs="mp4a.67.3""
assert_equals: supported expected false but got true

Test valid WebM type 
"audio/webm;codecs=vorbis;test="6""
assert_equals: supported expected false but got true


Test valid MP4 type
"video/mp4;codecs="avc1.4d001e""
assert_equals: supported expected true but got false


Test valid MP4 type
"video/mp4;codecs="avc1.42001e""
assert_equals: supported expected true but got false

Test valid MP4 type
"video/mp4;codecs="mp4a.40.2""
assert_equals: supported expected true but got false

Test valid MP4 type
"video/mp4;codecs="avc1.4d001e.mp4a.40.2""
assert_equals: supported expected true but got false

Test valid MP4 type
"video/mp4;codecs="mp4a.40.2 , avc1.4d001e""
assert_equals: supported expected true but got false

Test valid MP4 type
"video/mp4;codecs="avc1.4d001e.mp4a.40.5""
assert_equals: supported expected true but got false

Test valid MP4 type
"video/mp4;codecs="opus""
assert_equals: supported expected true but got false
Comment 18 Alex R 2020-05-26 14:21:22 PDT
Created attachment 400275 [details]
gst log filled up!
Comment 19 Alex R 2020-05-26 14:26:37 PDT
Created attachment 400276 [details]
gst-inspect output as requested
Comment 20 Alex R 2020-05-26 14:28:57 PDT
(In reply to Michael Catanzaro from comment #15)
> (In reply to Alex R from comment #9)
> > 0:00:00.052245439  3001 0xaaaae9f4ff50 WARN     GST_ELEMENT_FACTORY
> > gstelementfactory.c:456:gst_element_factory_make: no such element factory
> > "fdkaacdec"!
> 
> I think you're missing gst-plugins-bad?

purism@pureos:~$ sudo apt list "*gst-plugins-bad*"
Listing... Done
gir1.2-gst-plugins-bad-1.0/amber 1.14.4-1+b1 arm64

shall i install this and try running a youtube video?
Comment 21 Carlos Alberto Lopez Perez 2020-05-26 14:56:02 PDT
(In reply to Alex R from comment #20)
> (In reply to Michael Catanzaro from comment #15)
> > (In reply to Alex R from comment #9)
> > > 0:00:00.052245439  3001 0xaaaae9f4ff50 WARN     GST_ELEMENT_FACTORY
> > > gstelementfactory.c:456:gst_element_factory_make: no such element factory
> > > "fdkaacdec"!
> > 
> > I think you're missing gst-plugins-bad?
> 
> purism@pureos:~$ sudo apt list "*gst-plugins-bad*"
> Listing... Done
> gir1.2-gst-plugins-bad-1.0/amber 1.14.4-1+b1 arm64
> 
> shall i install this and try running a youtube video?

Is this a Librem phone?

In that case I think you are maybe missing the decoder for h264. To use a software-based decoder you can install the package gstreamer1.0-libav. And to use the hardware decoder from the i.MX8 VPU you need the gstreamer element providing support for that (its perhaps provided by the gstreamer-v4l2 ? not sure)
Comment 22 Alex R 2020-05-26 14:59:05 PDT
> Is this a Librem phone?
Its a PinePhone.
Comment 23 Philippe Normand 2020-05-26 23:59:47 PDT
You don't have an H264 decoder but it seems you fake an Android user-agent, which is expected to have have one.
Comment 24 Philippe Normand 2020-05-27 00:48:26 PDT
Which WebKitGTK version is this btw?
Here if I disable H264 support, VP9 is used instead. Then if I disable VP9, nothing plays.

Please provide a testable video link that is not the main youtube landing page itself.
Comment 25 Alex R 2020-05-27 09:54:59 PDT
(In reply to Philippe Normand from comment #24)
> Which WebKitGTK version is this btw?
libwebkit2gtk-4.0-37/amber-security,now 2.28.2-2~deb10u1 arm64 

> 
> Please provide a testable video link that is not the main youtube landing
> page itself.
Do you mean a youtube video? i guess try any mobile youtube video. 
e.g. if i do:

purism@pureos:~$ epiphany https://m.youtube.com/watch?v=EOwhuTlxE54

video page loads up like normal (grimes song). but then i press the red youtube play button and get the bug.
Comment 26 Alex R 2020-05-27 10:13:15 PDT
(In reply to Philippe Normand from comment #23)
> You don't have an H264 decoder but it seems you fake an Android user-agent,
> which is expected to have have one.

Ok, if this is my issue, thenhow do I go about getting a H264 decoder?
Comment 27 Philippe Normand 2020-05-27 10:20:05 PDT
for now install gst-libav as advised in comment 21.
For hw-accelerated playback I don't know... I suspect the v4l decoders can be used. It depends on your kernel and driver support for your GPU.

This is drifting off-topic now...
Comment 28 Philippe Normand 2020-05-27 10:23:16 PDT
Check the Lima driver, from Mesa.
Comment 29 Alex R 2020-05-27 12:10:52 PDT
(In reply to Philippe Normand from comment #27)
> for now install gst-libav as advised in comment 21.

gstreamer1.0-libav/amber,now 1.15.0.1+git20180723+db823502-2 arm64 [installed]

still encountering the bug
Comment 30 Carlos Alberto Lopez Perez 2020-05-27 17:45:13 PDT
(In reply to Alex R from comment #29)
> (In reply to Philippe Normand from comment #27)
> > for now install gst-libav as advised in comment 21.
> 
> gstreamer1.0-libav/amber,now 1.15.0.1+git20180723+db823502-2 arm64
> [installed]
> 
> still encountering the bug

Does this video https://people.igalia.com/clopez/wkbug/video/simplevideo.html work for you?
Comment 31 Alex R 2020-05-27 18:05:01 PDT
Yes it does work for me!
Comment 32 Alex R 2020-05-27 19:11:30 PDT
Actually, scratch that. I take that back. I accidentally tried it in firefox-esr and there it worked. Only seeing the controls in epiphany, but the video does not play in epiphany.
Comment 33 Michael Catanzaro 2020-05-27 19:24:31 PDT
Phil, are you leaving this open for a reason? Seems pretty clear the problem here is much deeper than WebKit if gst-libav doesn't support H.264?
Comment 34 Carlos Alberto Lopez Perez 2020-05-27 22:40:11 PDT
(In reply to Alex R from comment #32)
> Actually, scratch that. I take that back. I accidentally tried it in
> firefox-esr and there it worked. Only seeing the controls in epiphany, but
> the video does not play in epiphany.

Can you post the output of the following command?

$ gst-inspect-1.0 | grep 264

You should see something like:

libav:  avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder


If you don't see that, then this indicates your distribution (PureOS?) has not enabled the h264 decoder for the gst-libav package.


If that is the case, you might want to attempt to rebuild the gst-libav package in order to enable the h264 decoder.
Comment 35 Alex R 2020-05-28 10:09:03 PDT
(In reply to Carlos Alberto Lopez Perez from comment #34)
> Can you post the output of the following command?
> 
> $ gst-inspect-1.0 | grep 264

purism@pureos:~$ gst-inspect-1.0 | grep 264
libav:  avmux_ipod: libav iPod H.264 MP4 (MPEG-4 Part 14) muxer
libav:  avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
libav:  avenc_h264_omx: libav OpenMAX IL H.264 video encoder encoder
typefindfunctions: video/x-h264: h264, x264, 264
videoparsersbad:  h264parse: H.264 parser
rtp:  rtph264depay: RTP H264 depayloader
rtp:  rtph264pay: RTP H264 payloader
uvch264:  uvch264mjpgdemux: UVC H264 MJPG Demuxer
uvch264:  uvch264src: UVC H264 Source
Comment 36 Alex R 2020-05-28 10:19:40 PDT
gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ user-agent "Mozilla/5.0 (Android 4.4.2; U; Mobian 20052020; rv:68.0) Gecko/68.0 Firefox/68.0 Mobian/20052020 like Safari/538.1"

This makes youtube work in browser in epiphany. ticket can be closed. thanks for everyone's time.
Comment 37 Carlos Alberto Lopez Perez 2020-05-28 13:37:36 PDT
(In reply to Alex R from comment #36)
> gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ user-agent
> "Mozilla/5.0 (Android 4.4.2; U; Mobian 20052020; rv:68.0) Gecko/68.0
> Firefox/68.0 Mobian/20052020 like Safari/538.1"
> 

What is Mobian ??