After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672439 - Transcoding to MPEG broken on Ubuntu 12.04
Transcoding to MPEG broken on Ubuntu 12.04
Status: RESOLVED NOTGNOME
Product: rygel
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: rygel-maint
rygel-maint
: 674700 (view as bug list)
Depends on: 674920
Blocks:
 
 
Reported: 2012-03-20 07:37 UTC by Adam Reeve
Modified: 2013-01-23 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debug output when trying to play xvid video on TV (31.67 KB, text/plain)
2012-03-21 08:48 UTC, Adam Reeve
Details

Description Adam Reeve 2012-03-20 07:37:38 UTC
I have a Sony Bravia KDL-40EX520 TV, and am having problems playing some videos. I'm using Ubuntu 12.04 and have compiled Rygel from the current git master (8b3f85122b4e079ba5ce9adf0343b9afb01c1964). 

Some video files work fine, it seems that MPEG-3 files work without any problem.

Trying to play an H-264 video with MPEG-AAC audio in an mkv container I get a blank screen on my TV and rygel with the debug level set to 5 shows:

Rygel-CRITICAL **: Error from pipeline RygelHTTPGstResponse: matroska-demux.c(4492): gst_matroska_demux_loop (): /GstPipeline:RygelHTTPGstResponse/GstBin:transcoder-source/GstDecodeBin2:decodebin2/GstMatroskaDemux:matroskademux0:
stream stopped, reason not-negotiated
0:00:27.875964071  6327      0x2516010 DEBUG              mpegtsmux mpegtsmux.c:1047:mpegtsmux_release_pad:<muxer> Pad <muxer:sink_65> being released
0:00:27.885447062  6327      0x2516010 DEBUG              mpegtsmux mpegtsmux.c:1047:mpegtsmux_release_pad:<muxer> Pad <muxer:sink_64> being released

Rygel-CRITICAL **: Error from pipeline RygelHTTPGstResponse: matroska-demux.c(4492): gst_matroska_demux_loop (): /GstPipeline:RygelHTTPGstResponse/GstBin:transcoder-source/GstDecodeBin2:decodebin2/GstMatroskaDemux:matroskademux1:
stream stopped, reason not-negotiated

And then I have some MPEG-4 XVID videos with MPEG 1/2/3 (mpga) audio (according to VLC). These show "Playback not available" on my TV and rygel doesn't show any output at all.
Comment 1 Jens Georg 2012-03-20 09:11:26 UTC
Well your TV only does MPEG2, so we need to transcode. Why on earth that is broken again, I don't know. Have to look into that.
Comment 2 Adam Reeve 2012-03-20 09:35:02 UTC
Is there anything I can do to get some more detailed debugging information?
Comment 3 Jens Georg 2012-03-20 09:38:36 UTC
Can you paste your gstreamer versions?
Comment 4 Adam Reeve 2012-03-20 09:43:35 UTC
I'm using the ones from the 12.04 repositories, hopefully I've listed the important ones:

libgstreamer0.10-0:
  Installed: 0.10.36-1
  Candidate: 0.10.36-1
  Version table:
 *** 0.10.36-1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
gstreamer0.10-plugins-base:
  Installed: 0.10.36-1
  Candidate: 0.10.36-1
  Version table:
 *** 0.10.36-1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
gstreamer0.10-plugins-good:
  Installed: 0.10.31-1ubuntu1
  Candidate: 0.10.31-1ubuntu1
  Version table:
 *** 0.10.31-1ubuntu1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
gstreamer0.10-plugins-bad:
  Installed: 0.10.22.3-2ubuntu1
  Candidate: 0.10.22.3-2ubuntu1
  Version table:
 *** 0.10.22.3-2ubuntu1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status
gstreamer0.10-ffmpeg:
  Installed: 0.10.13-1
  Candidate: 0.10.13-1
  Version table:
 *** 0.10.13-1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status
gstreamer0.10-plugins-ugly:
  Installed: 0.10.18.3-1ubuntu1
  Candidate: 0.10.18.3-1ubuntu1
  Version table:
 *** 0.10.18.3-1ubuntu1 0
        500 http://nz.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status
Comment 5 Jens Georg 2012-03-20 10:17:05 UTC
Can reproduce here. How many audio streams does that MKV file have?

As for the XVID case, try to rerun with G_MESSAGES_DEBUG=all
Comment 6 Jens Georg 2012-03-20 12:27:42 UTC
hm, works with those versions here locally but not on 12.04. I'm tempted to say it's an ubuntu issue
Comment 7 Jens Georg 2012-03-20 12:42:03 UTC
Btw, does latest stable (0.12.7) work for you?
Comment 8 Jens Georg 2012-03-20 12:52:09 UTC
and does the mkv work for you in gst-launch playbin2 uri=file:///... ?
Comment 9 Adam Reeve 2012-03-21 08:48:57 UTC
Created attachment 210222 [details]
Debug output when trying to play xvid video on TV

The mkv has one audio stream. It's got one video, one audio and one subtitle track. Running gst-launch playbin2 seems to work fine, the video appears and plays. Same for the XVID file.

I couldn't get 0.12.7 to work, building it works if I disable the strict-vala option and increase LIBSOUP_MAX_VERSION, but running it I get:

(rygel:4345): GLib-GObject-WARNING **: cannot register existing type `RygelMPRISPluginFactory'

(rygel:4345): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(rygel:4345): GLib-GObject-WARNING **: cannot create new instance of invalid (non-instantiatable) type `<invalid>'

I can run 0.12.6 from the Ubuntu repositories, and then with both the xvid and mkv files I get video but no audio, and fast-forwarding doesn't work. I tried with 0.12.6 compiled from git and that gives me the same result as the Ubuntu package.
Comment 10 Jens Georg 2012-03-22 08:03:18 UTC
(In reply to comment #9)
> Created an attachment (id=210222) [details]
> Debug output when trying to play xvid video on TV
> 
> The mkv has one audio stream. It's got one video, one audio and one subtitle
> track. Running gst-launch playbin2 seems to work fine, the video appears and
> plays. Same for the XVID file.

I find it interesting that the TV tries to play the AVI file directly with 0.13 for some reason...

Can you also run gupnp-dlna-info -v on the mkv please? It's in gupnp-dlna-tools.

> 
> I couldn't get 0.12.7 to work, building it works if I disable the strict-vala
> option and increase LIBSOUP_MAX_VERSION, but running it I get:

Yeah, sorry about that.

> 
> (rygel:4345): GLib-GObject-WARNING **: cannot register existing type
> `RygelMPRISPluginFactory'
> 
> (rygel:4345): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0'
> failed
> 
> (rygel:4345): GLib-GObject-WARNING **: cannot create new instance of invalid
> (non-instantiatable) type `<invalid>'

That's when it finds its plug-ins twice for some reason. Did you by chance run configure with --enable-uninstalled and called make install?


> I can run 0.12.6 from the Ubuntu repositories, and then with both the xvid and
> mkv files I get video but no audio, and fast-forwarding doesn't work. I tried
> with 0.12.6 compiled from git and that gives me the same result as the Ubuntu
> package.

Fast-forwarding not working is bug 665476. Audio definitely works for me here and 0.12.6 on PP. Can you try to play the transcoded streams with mplayer? You can get the link using gupnp-av-cp, right-click on a item and select "Fetch DIDL-Lite". It's the one with MPEG_*_ISO in it.
Comment 11 Jens Georg 2012-03-23 09:33:07 UTC
fwiw, I filed a bug to ubuntu:

https://bugs.launchpad.net/ubuntu/+source/gstreamer0.10/+bug/960214
Comment 12 Adam Reeve 2012-03-25 09:19:09 UTC
Oh right, yes I must have compiled 0.12.7 with --enable-uninstalled. It runs fine now and gives the same results as 0.12.6 (no sound for either file and no fast forwarding). Bug 665476 does look like the same problem when fast forwarding, I get the same error message.

Playing the URI from "fetch DIDL-Lite" with mplayer works and has sound for both the avi and mkv file. In the mplayer output the audio codec is listed as "AAC(pid=64)" for the mkv and "MPA(pid=64)" for the avi. Is that expected? (This is on 0.12.7, I'll also try later on 0.13.)

When I get some more time I'll try using git bisect to track down what change caused me to go from getting video to getting the "playback not available" message in more recent versions.

Here's the output from gupnp-dlna-info -v on the mkv:

$ gupnp-dlna-info -v ~/Videos/movies/The_Castle.mkv 

URI: file:///home/adam/Videos/movies/The_Castle.mkv
Profile Name: (null)
Profile MIME: (null)

Topology:
  container: video/x-matroska
    video: video/x-dvd-subpicture, codec_data=(buffer)73697a653a20373230783537360a6f72673a20302c20300a7363616c653a20313030252c20313030250a616c7068613a20313030250a736d6f6f74683a204f46460a66616465696e2f6f75743a2035302c2035300a616c69676e3a204f4646206174204c45465420544f500a74696d65206f66667365743a20300a666f7263656420737562733a204f46460a70616c657474653a206666336530662c206666393432612c206666636332392c206666666632612c203939643933362c203433616333392c203030663732302c203030633065662c203030303063662c203566303034662c206636316436302c206665666566652c206233623362332c203830383038302c203464346434642c203030303030300a637573746f6d20636f6c6f72733a204f46462c2074726964783a20303030302c20636f6c6f72733a203030303030302c203030303030302c203030303030302c203030303030300a00
      Codec:
        video/x-dvd-subpicture, codec_data=(buffer)73697a653a20373230783537360a6f72673a20302c20300a7363616c653a20313030252c20313030250a616c7068613a20313030250a736d6f6f74683a204f46460a66616465696e2f6f75743a2035302c2035300a616c69676e3a204f4646206174204c45465420544f500a74696d65206f66667365743a20300a666f7263656420737562733a204f46460a70616c657474653a206666336530662c206666393432612c206666636332392c206666666632612c203939643933362c203433616333392c203030663732302c203030633065662c203030303063662c203566303034662c206636316436302c206665666566652c206233623362332c203830383038302c203464346434642c203030303030300a637573746f6d20636f6c6f72733a204f46462c2074726964783a20303030302c20636f6c6f72733a203030303030302c203030303030302c203030303030302c203030303030300a00
      Additional info:
        None
      Width: 0
      Height: 0
      Depth: 0
      Frame rate: 0/0
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 0
      Max bitrate: 0
      Tags:
        taglist, language-code=(string)en, container-format=(string)Matroska;
    audio: audio/mpeg, mpegversion=(int)4, framed=(boolean)true, codec_data=(buffer)1190, channels=(int)2, rate=(int)48000, stream-format=(string)raw
      Codec:
        audio/mpeg, mpegversion=(int)4, framed=(boolean)true, codec_data=(buffer)1190, channels=(int)2, rate=(int)48000, stream-format=(string)raw
      Additional info:
        None
      Channels: 2
      Sample rate: 48000
      Depth: 16
      Bitrate: 0
      Max bitrate: 0
      Tags:
        taglist, audio-codec=(string)"MPEG-4\ AAC\ audio", language-code=(string)en, container-format=(string)Matroska;
    video: video/x-h264, level=(string)3, profile=(string)main, codec_data=(buffer)014d401effe1001f674d401eeca05a0937fe0080005ad418041900000300010002bf200f162d9601000568eac1b2c8, stream-format=(string)avc, alignment=(string)au, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)64/45, framerate=(fraction)25/1
      Codec:
        video/x-h264, level=(string)3, profile=(string)main, codec_data=(buffer)014d401effe1001f674d401eeca05a0937fe0080005ad418041900000300010002bf200f162d9601000568eac1b2c8, stream-format=(string)avc, alignment=(string)au, width=(int)720, height=(int)576, pixel-aspect-ratio=(fraction)64/45, framerate=(fraction)25/1
      Additional info:
        None
      Width: 720
      Height: 576
      Depth: 0
      Frame rate: 25/1
      Pixel aspect ratio: 64/45
      Interlaced: false
      Bitrate: 0
      Max bitrate: 0
      Tags:
        taglist, video-codec=(string)H264, container-format=(string)Matroska;

Duration:
  1:21:49.000000000
Comment 13 Adam Reeve 2012-03-27 07:59:41 UTC
So I tried playing the URL from gupnp-av-cp with mplayer on 0.13, and get this error in rygel that doesn't show up when I play from the TV, so I'm not sure if it's the same problem or something else:

rygel:
(rygel:5679): Rygel-DEBUG: rygel-http-server.vala:148: HTTP GET request for URI 'http://127.0.0.1:42910/MediaExport/i/NjJmOGZiMmRiODFhMWNlZWE0ZTVmNjZhMjkzZjc0ZjE=/tr/MPEG_TS_HD_NA_ISO.mpg'. Headers:
(rygel:5679): Rygel-DEBUG: rygel-http-server.vala:152: Host : 127.0.0.1:42910
(rygel:5679): Rygel-DEBUG: rygel-http-server.vala:152: User-Agent : MPlayer svn r34540 (Ubuntu), built with gcc-4.6
(rygel:5679): Rygel-DEBUG: rygel-http-server.vala:152: icy-metadata : 1
(rygel:5679): Rygel-DEBUG: rygel-http-server.vala:152: Connection : close
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:171: Following HTTP headers appended to response:
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:173: Date : Tue, 27 Mar 2012 05:40:58 GMT
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:173: Content-Type : video/mpeg
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:173: TimeSeekRange.dlna.org : npt=0.000-5356.999/5357.000
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:173: contentFeatures.dlna.org : DLNA.ORG_PN=MPEG_TS_HD_NA_ISO;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000
(rygel:5679): Rygel-DEBUG: rygel-http-get.vala:173: Connection : close
(rygel:5679): Rygel-DEBUG: rygel-transcoder.vala:75: RygelMP2TSTranscoder using the following encoding profile:
(rygel:5679): Rygel-DEBUG:   container:
(rygel:5679): Rygel-DEBUG:     Format: video/mpegts, systemstream=(boolean)true, packetsize=(int)188
(rygel:5679): Rygel-DEBUG:       audio:
(rygel:5679): Rygel-DEBUG:         Format: audio/mpeg, mpegversion=(int)1, layer=(int)2
(rygel:5679): Rygel-DEBUG:       video:
(rygel:5679): Rygel-DEBUG:         Format: video/mpeg, mpegversion=(int)2, systemstream=(boolean)false
(rygel:5679): Rygel-DEBUG:         Restriction: video/x-raw-yuv, framerate=(fraction)30/1, width=(int)1280, height=(int)720
**ERROR: [rygel] For MPEG-1, aspect ratio code  0 is illegal

I also found that where version 0.13 branches from 0.12, my TV gives the "playback not available" message, so I did a bisect on the 0.12 branch to find out when video playback started working, and found that it was commit fa2a5ca3ea78f4bc92e08b3ac3290fa61a80e1d9, "core: Revert encodebin-based transcoder". The commit before this I get no playback, and at this commit I get video but no audio.
Comment 14 Jens Georg 2012-04-26 17:53:18 UTC
*** Bug 674700 has been marked as a duplicate of this bug. ***
Comment 15 Jens Georg 2012-04-26 19:16:24 UTC
Actually the issue is the transcoding to mpeg. The reason seems that in contrast to upstream, the mpeg2enc plugin and the ffenc_mpeg2video habe the same rank secondary; encodebin seems to select the mpeg2enc plugin then which causes the issue. Moving /usr/lib/gstreamer-0.10/libgstmpeg2enc.so out of the way makes transcoding work again.
Comment 16 Jens Georg 2012-04-26 19:21:18 UTC
the work-around is to remove gstreamer0.10-plugins-bad-multiverse
Comment 17 Jens Georg 2013-01-23 20:44:36 UTC
Ubuntu issue and solved with the package from https://launchpad.net/~yg-jensge/+archive/gupnp