LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-22-2015, 04:11 AM   #1
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
Firefox and MP4 videos (HTML5 <video> element)


Hi everyone,

according to Mozilla guidelines, latest versions of Firefox should support MP4 video streams inside <video> elements when an external plugin (namely, gstreamer 1.0) is available.
However, after installing gstreamer1 packages from SBo, the support is still not available, probably because the package was not build with support to the gstreamer libs (not available in Slackware tree). This can also be seen in the about:buildconfig page, as --enable-gstreamer1 is not listed in build-time options.
Trying to rebuild the mozilla-firefox package with this support using the original source and SlackBuild fails during the linking phase.
Anyone has ever tried this?

BTW, I'm on a Slackware-current system.
 
Old 02-22-2015, 04:30 AM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I've built Firefox in B/LFS with GStreamer media support, but I do believe the Firefox Nightly builds come with it enabled.

Are you sure it's GStreamer-1.x or 0.x that's needed?

Last edited by ReaperX7; 02-22-2015 at 04:31 AM.
 
Old 02-22-2015, 05:06 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
I think it should work fine with both gstreamer versions, 0.10.x, the default (support for which is already built in Slackware's firefox, despite the option --enable-gstreamer=0.10 not being specified at build time), and 1.x (support for which you enable specifying between the build options --enable-gstreamer=1.0): you probably need gst-plugins-bad and gst-plugins-ugly from SBo, that contain support for the codec h264 and aac (needed also to see youtube video with the html5 interface).
I tested it here with this sample code served by my apache
Code:
<!doctype html>
<html>
<body>
<video controls>
  <source src="/videos/mov_bbb.mp4" type="video/mp4">
</video>
</body>
</html>
got the video from here (source).

Quote:
Originally Posted by 414N View Post
Trying to rebuild the mozilla-firefox package with this support using the original source and SlackBuild fails during the linking phase.
this is most probably a RAM issue: most recent versions need a lot of RAM and swap during that step (here, building with PGO, I use 10 Gb of RAM and 10 Gb of swap).

Last edited by ponce; 02-22-2015 at 05:18 AM.
 
Old 02-22-2015, 05:37 AM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I build with 8GB of Swap and never recommend anything less for building things like Firefox, Seamonkey, or Webkitgtk based browsers like Midori.
 
Old 02-22-2015, 07:16 AM   #5
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by ponce View Post
I think it should work fine with both gstreamer versions, 0.10.x, the default (support for which is already built in Slackware's firefox, despite the option --enable-gstreamer=0.10 not being specified at build time), and 1.x (support for which you enable specifying between the build options --enable-gstreamer=1.0): you probably need gst-plugins-bad and gst-plugins-ugly from SBo, that contain support for the codec h264 and aac (needed also to see youtube video with the html5 interface).
Well, truth is I installed all those packages and something more:
Code:
$ ls /var/log/packages/gst*
/var/log/packages/gst-plugins-bad-0.10.23-x86_64-3_SBo
/var/log/packages/gst-plugins-base-0.10.36-x86_64-2
/var/log/packages/gst-plugins-base-compat32-0.10.36-x86_64-2compat32
/var/log/packages/gst-plugins-good-0.10.31-x86_64-5
/var/log/packages/gst-plugins-good-compat32-0.10.31-x86_64-5compat32
/var/log/packages/gst-plugins-ugly-0.10.19-x86_64-2_SBo
/var/log/packages/gst-plugins-ugly-compat32-0.10.19-x86_64-1C32compat32
/var/log/packages/gst1-libav-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-bad-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-base-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-ugly-1.4.1-x86_64-1_SBo
/var/log/packages/gstreamer-0.10.36-x86_64-2
/var/log/packages/gstreamer-compat32-0.10.36-x86_64-2compat32
/var/log/packages/gstreamer1-1.4.1-x86_64-1_SBo
and I guess gstreamer supports h264 decoding (at least) by this:
Code:
gst-inspect | grep -i -E '(mp4|h264)'
h264parse:  legacyh264parse: H264Parse
videoparsersbad:  h264parse: H.264 parser
vdpau:  vdpauh264dec: VDPAU H264 Decoder
isomp4:  qtmoovrecover: QT Moov Recover
isomp4:  mj2mux: MJ2 Muxer
isomp4:  gppmux: 3GPP Muxer
isomp4:  3gppmux: 3GPP Muxer
isomp4:  ismlmux: ISML Muxer
isomp4:  mp4mux: MP4 Muxer
isomp4:  qtmux: QuickTime Muxer
isomp4:  rtpxqtdepay: RTP packet depayloader
isomp4:  qtdemux: QuickTime demuxer
rtp:  rtpmp4gpay: RTP MPEG4 ES payloader
rtp:  rtpmp4gdepay: RTP MPEG4 ES depayloader
rtp:  rtpmp4adepay: RTP MPEG4 audio depayloader
rtp:  rtpmp4apay: RTP MPEG4 audio payloader
rtp:  rtpmp4vdepay: RTP MPEG4 video depayloader
rtp:  rtpmp4vpay: RTP MPEG4 Video payloader
rtp:  rtph264pay: RTP H264 payloader
rtp:  rtph264depay: RTP H264 depayloader
typefindfunctions: video/x-h264: h264, x264, 264
but still there's no mp4 <video> support in Firefox.
I guess that gstreamer gets loaded with a dlopen-type call and not on application loading, as there would be a gstreamer entry in the output of the ldd command.
I tried a run with strace, and saw that it finds and opens every gstreamer lib in /usr/lib64/gstreamer-0.10/, but then I got no clue at what's going wrong...

Quote:
Originally Posted by ponce View Post
this is most probably a RAM issue: most recent versions need a lot of RAM and swap during that step (here, building with PGO, I use 10 Gb of RAM and 10 Gb of swap).
I didn't monitor RAM usage, but I guess I'll do if I try again another build. Thanks for the suggestion
 
Old 02-22-2015, 08:29 AM   #6
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 411

Rep: Reputation: 181Reputation: 181
Quote:
Originally Posted by 414N View Post
I tried a run with strace, and saw that it finds and opens every gstreamer lib in /usr/lib64/gstreamer-0.10/, but then I got no clue at what's going wrong...
That most likely means that it has been built against gstreamer 0.10.x. There has to be an option "--enable-gstreamer=1.0" in the SlackBuild to point it to the 1.x libraries.

I took a little different approach with Firefox here - I built gstreamer 1.x and put it into /opt. Afterwards, I put this line into my SlackBuild to link Firefox against it:

Code:
export PKG_CONFIG_PATH=/opt/gstreamer1-banshee/usr/lib64/pkgconfig
export LDFLAGS="-Wl,-rpath,/opt/gstreamer1-banshee/usr/lib64,-enable-new-dtags"
Works fine since I started with this (Firefox 30). SlackBuilds are in my signature.
 
Old 02-22-2015, 02:16 PM   #7
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
do the test I linked also above works for you?
https://i.imgur.com/6TTx2OU.png
Quote:
Originally Posted by 414N View Post
Well, truth is I installed all those packages and something more:
Code:
$ ls /var/log/packages/gst*
/var/log/packages/gst-plugins-bad-0.10.23-x86_64-3_SBo
/var/log/packages/gst-plugins-base-0.10.36-x86_64-2
/var/log/packages/gst-plugins-base-compat32-0.10.36-x86_64-2compat32
/var/log/packages/gst-plugins-good-0.10.31-x86_64-5
/var/log/packages/gst-plugins-good-compat32-0.10.31-x86_64-5compat32
/var/log/packages/gst-plugins-ugly-0.10.19-x86_64-2_SBo
/var/log/packages/gst-plugins-ugly-compat32-0.10.19-x86_64-1C32compat32
/var/log/packages/gst1-libav-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-bad-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-base-1.4.1-x86_64-1_SBo
/var/log/packages/gst1-plugins-ugly-1.4.1-x86_64-1_SBo
/var/log/packages/gstreamer-0.10.36-x86_64-2
/var/log/packages/gstreamer-compat32-0.10.36-x86_64-2compat32
/var/log/packages/gstreamer1-1.4.1-x86_64-1_SBo
and I guess gstreamer supports h264 decoding (at least) by this:
Code:
gst-inspect | grep -i -E '(mp4|h264)'
h264parse:  legacyh264parse: H264Parse
videoparsersbad:  h264parse: H.264 parser
vdpau:  vdpauh264dec: VDPAU H264 Decoder
isomp4:  qtmoovrecover: QT Moov Recover
isomp4:  mj2mux: MJ2 Muxer
isomp4:  gppmux: 3GPP Muxer
isomp4:  3gppmux: 3GPP Muxer
isomp4:  ismlmux: ISML Muxer
isomp4:  mp4mux: MP4 Muxer
isomp4:  qtmux: QuickTime Muxer
isomp4:  rtpxqtdepay: RTP packet depayloader
isomp4:  qtdemux: QuickTime demuxer
rtp:  rtpmp4gpay: RTP MPEG4 ES payloader
rtp:  rtpmp4gdepay: RTP MPEG4 ES depayloader
rtp:  rtpmp4adepay: RTP MPEG4 audio depayloader
rtp:  rtpmp4apay: RTP MPEG4 audio payloader
rtp:  rtpmp4vdepay: RTP MPEG4 video depayloader
rtp:  rtpmp4vpay: RTP MPEG4 Video payloader
rtp:  rtph264pay: RTP H264 payloader
rtp:  rtph264depay: RTP H264 depayloader
typefindfunctions: video/x-h264: h264, x264, 264
but still there's no mp4 <video> support in Firefox.
I just noticed running the same gst-inspect line, that I have also gst-ffmpeg installed that you don't: shouldn't be needed, but who knows...
 
Old 02-22-2015, 02:36 PM   #8
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by ponce View Post
I just noticed running the same gst-inspect line, that I have also gst-ffmpeg installed that you don't: shouldn't be needed, but who knows...
And that was it! Installing gst-ffmpeg solved the issue. Seems like Firefox relies on the H264 implementation found in ffmpeg.
Thanks everyone :-)
 
1 members found this post helpful.
Old 02-22-2015, 03:29 PM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
No need to rebuild Firefox, the binary packages provided by Mozilla will play HTML5 H264 so long as you have the correct GStreamer libs installed. You can use this to repackage the Mozilla provided binary into Slackware packaging format:

https://gist.github.com/ruario/9672798

EDIT: Ok, ponce stated that the Slackware provided Firefox has support as well if I read correctly. In that case, ignore me.

Last edited by ruario; 02-22-2015 at 03:33 PM.
 
Old 02-22-2015, 04:55 PM   #10
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368

Rep: Reputation: 165Reputation: 165
this means you are using gstreamer 0.10
gst-ffmpeg = gstreamer 0.10
gst-libav = gstreamer 1.0

so if it works with gst-ffmpeg than firefox is linking to your gstreamer 0.10
 
Old 02-23-2015, 04:58 AM   #11
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,130

Rep: Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202Reputation: 4202
Quote:
Originally Posted by 414N View Post
And that was it! Installing gst-ffmpeg solved the issue. Seems like Firefox relies on the H264 implementation found in ffmpeg.
well, I just tried uninstalling gst-plugins-bad, gst-plugins-ugly and ffmpeg and it still works: seems it needs just gst-ffmpeg alone (that should have an integrated ffmpeg version), beside what's already in standard Slackware.
 
Old 02-23-2015, 02:44 PM   #12
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by ponce View Post
well, I just tried uninstalling gst-plugins-bad, gst-plugins-ugly and ffmpeg and it still works: seems it needs just gst-ffmpeg alone (that should have an integrated ffmpeg version), beside what's already in standard Slackware.
I confirm: during the build of gst-ffmpeg, I saw it was configuring and compiling an ffmpeg version that (I guess) it statically links to its own library.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html5 & css, centering the canvas element S. Chapelin Programming 5 05-05-2012 02:19 AM
No pic w/video playback .flv and .mp4 videos snatale1 Linux Mint 5 07-02-2011 09:50 AM
[SOLVED] Firefox 4 in Slackware 12.2 and HTML5 video problem mycinka Slackware 1 03-23-2011 08:52 AM
Combining .mp4 videos Poetics Linux - General 1 05-29-2007 08:30 PM
Videos in Firefox have sound + video synch problem Adrian Baker Linux - Software 3 10-24-2006 06:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration