GNOME Bugzilla – Bug 722682
oggmux: problems with vp8 stream
Last modified: 2014-03-11 16:15:19 UTC
Trying to remux a webm file into Ogg (both audio and video): 0:00:10.474941625 2006 0x7f4a54039000 ERROR oggmux gstoggmux.c:982:gst_ogg_mux_queue_pads:<muxer:video_100562434> mapper didn't recognise input stream (pad caps: video/x-vp8, width=(int)640, height=(int)360, framerate=(fraction)90001/1) 0:00:14.335932799 2006 0x7f4a540390f0 ERROR vp8enc gstvp8enc.c:1887:gst_vp8_enc_finish:<vp8enc0> encode returned 1 error The resulting ogg file is unplayable.
This happens because there is no streamheader in caps when data comes from another demuxer. Encoding directly from vp8enc has streamheader. Additionally, oggmux doesn't receive the expected "OVP80" as the beginning of the stream and doesn't identify it as vp8. Can't oggmux simply fallback to trusting the input caps in this case?
<cschalle> thiagoss, hey, thanks for looking at that vp8 remuxing bug, one question though, would that mean I should get the same issue remuxing vorbis from matroska to ogg? <slomo> cschalle: no, for vorbis/theora/others matroskademux is adding streamheader to the caps <-- Mista_D has quit () <cschalle> slomo, ah ok, is there anything stopping us from doing that with vp8 too? <slomo> cschalle: don't think so
Isn't a bit too specific to go adding those stream headers in demuxers if they are only used for ogg? Shouldn't oggmux care for creating them instead of replicating this code?
I agree that it should probably be oggmux creating them, since this is specific to the VP8 Ogg mapping. For Vorbis and Theora the stream headers are passed to the codecs and also need to be put into/extracted from the matroska headers in order for matroska files to be streamable with those codecs, so it's different there. So I'd say: - don't make vp8enc add ogg-specific streamheaders to caps - make oggmux create the stream/id header from the input caps, assuming default values for pixel-aspect-ratio if not present (should probably require a framerate though?) - make sure not to duplicate out-of-band headers and in-stream headers when remuxing ogg (probably already does that)
Thiago are you still looking at this?
Created attachment 271029 [details] [review] oggmux: create vp8 header data if not provided in caps This patch works, except that oggmux still requires the buffer to have its OFFSET and OFFSET_END set to ogg specific data (granulepos) which vp8enc does but other demuxers won't. I guess this should, too, be moved to be handled in ogg to avoid replication of this code in all demuxers. Apparently this is harder with vp8 because it contains invisible frames. On another issue, removing the streamheaders generation from vp8enc also removes the header buffer it generates for tags. Do we want to still keep that? From oggmux's logic either we keep both stream header buffers or none. If we decide to go for none vp8enc tagsetter interface would be used to push the tags downstream? If there are no muxers further downstream the tags are going to be lost, but they are anyway if the muxer isn't oggmux.
Created attachment 271118 [details] [review] oggmux: implement vp8 granulepos function Add an extra function to the oggstream map to inform it about the incoming buffers. This way oggmux can keep a count on the vp8 invisible frames and calculate the granulepos correctly.
Review of attachment 271029 [details] [review]: Looks good
Review of attachment 271118 [details] [review]: And this too
Tested the patches today, they fix remuxing from webm to ogg for me.
Ok, was a little quick with that comment :) The remux seems to go fine, reming both audio and vidoe, but in the terminal I get the following message: 0:00:12.777693051 17994 0x7f433403b4f0 ERROR vp8enc gstvp8enc.c:1887:gst_vp8_enc_finish:<vp8enc0> encode returned 1 error When I try to play the generated file in Totem I get a missing plugin message: ** Message: PackageKit: xid = 20971536 ** Message: PackageKit: Codec nice name: application/x-unknown decoder ** Message: PackageKit: ignoring field named streamheader ** Message: PackageKit: structure: gstreamer1(decoder-application/x-unknown)()(64bit) The file does not play. It doesn't play in mplayer either, although I don't know if mplayer is even supposed to support VP8 in Ogg. If I try to re-encode the video in vp8 that doesn't seem to work either, so it seems putting vp8 in Ogg got general issues here.
Hi Christian, it seems to be working here. Any particular file or configuration on generating it?
I am using the test files from here: http://www.webmfiles.org/demo-files/ And then trying to remux them using git master transmageddon.
Created attachment 271517 [details] Dotfile graph from transmageddon
(In reply to comment #14) > Created an attachment (id=271517) [details] > Dotfile graph from transmageddon This seems to be incomplete, it only shows the encodebin element and filesink, no sources or decoders anywhere. Is there any dot file with a complete graph? Also, remuxing with gst-launch-1.0 works: gst-launch-1.0 filesrc location=~/media/big-buck-bunny_trailer.webm ! matroskademux name=d ! queue ! oggmux name=m ! filesink location=test.ogg d. ! queue ! "audio/x-vorbis" ! m. Is there anything special with transmageddon other than it using encodebin?
I just tested with transmageddon from git and it works, too.
I re-tested with fresh checkout. Works fine, so please commit. And thank you :)
commit a2633b7cf1d7dbff349649503083c0f9683d2ba8 Author: Thiago Santos <ts.santos@sisa.samsung.com> Date: Thu Mar 6 12:59:08 2014 -0300 oggmux: implement vp8 granulepos function Add an extra function to the oggstream map to inform it about the incoming buffers. This way oggmux can keep a count on the vp8 invisible frames and calculate the granulepos correctly. https://bugzilla.gnome.org/show_bug.cgi?id=722682 commit e00c30657197551ccb52d8ad83fa495b93875240 Author: Thiago Santos <ts.santos@sisa.samsung.com> Date: Wed Mar 5 16:34:42 2014 -0300 oggmux: create vp8 header data if not provided in caps vp8 stream header shouldn't be assumed to be provided in caps always as this would repeat the same code in all demuxers/encoders. Instead, make oggmux generate them if they are not supplied. https://bugzilla.gnome.org/show_bug.cgi?id=722682