GNOME Bugzilla – Bug 719799
vp8enc: Fails to renegotiate if irrelevant parts of the caps change
Last modified: 2016-02-05 11:44:01 UTC
vp8enc fails some where about at 45min on this dvd: https://www.dropbox.com/s/rzn444d9sz8k8pa/stream.dump i use this script to encode it: echo "======== VIDEO, pass 1 =========" date gst-launch-1.0 filesrc location=stream.dump ! mpegpsdemux name=demux demux.video_e0 ! mpegvideoparse ! mpeg2dec ! videorate ! \ vp8enc threads=2 multipass-mode=1 target-bitrate=1000000 \ multipass-cache-file=multipass.cache end-usage=vbr auto-alt-ref=1 \ keyframe-max-dist=360 min-quantizer=0 max-quantizer=60 \ token-partitions=2 lag-in-frames=16 ! fakesink echo "======== VIDEO, pass 2 =========" date gst-launch-1.0 filesrc location=stream.dump ! mpegpsdemux name=demux \ webmmux name=mux ! filesink location=out_video.webm \ demux.video_e0 ! mpegvideoparse ! mpeg2dec ! videorate ! \ vp8enc threads=2 multipass-mode=2 target-bitrate=1000000 \ multipass-cache-file=multipass.cache end-usage=vbr auto-alt-ref=1 \ keyframe-max-dist=360 min-quantizer=0 max-quantizer=60 \ token-partitions=2 lag-in-frames=16 ! queue ! mux. \ demux.audio_81 ! a52dec mode=2 ! audiorate tolerance=50000000 ! \ audioconvert ! audioresample ! \ taginject tags="language-code=eng" ! queue ! vorbisenc ! mux. \ demux.audio_80 ! a52dec mode=2 ! audiorate tolerance=50000000 ! \ audioconvert ! audioresample ! \ taginject tags="language-code=ger" ! queue ! vorbisenc ! mux. Already on first pass vp8enc will fail.
Here is error message: ERROR: from element /GstPipeline:pipeline0/GstVP8Enc:vp8enc0: GStreamer error: negotiation problem. Additional debug info: gstvideoencoder.c(1366): gst_video_encoder_chain (): /GstPipeline:pipeline0/GstVP8Enc:vp8enc0:
What's the output with gst-launch-1.0 -v? Also try inserting a videoconvert in front of the encoder.
Created attachment 263583 [details] error.log Here is error log with gst-launch-1.0 -v and videoconvert. SO answer is yes, it fails with videoconvert too. It takes about 40 minutes until it fail.
It fails one frame before end of stream on caps renegotiation. The caps are same, so probably encoder should accept it end not fail.
With this workaround I'm able to encode this any many other videos: diff --git a/ext/vpx/gstvp8enc.c b/ext/vpx/gstvp8enc.c index d68cdff..8bb64e4 100644 --- a/ext/vpx/gstvp8enc.c +++ b/ext/vpx/gstvp8enc.c @@ -1511,7 +1511,8 @@ gst_vp8_enc_set_format (GstVideoEncoder * video_encoder, if (encoder->inited) { GST_DEBUG_OBJECT (video_encoder, "refusing renegotiation"); - return FALSE; + //return FALSE; + return TRUE; } g_mutex_lock (&encoder->encoder_lock);
The caps are not the same, the interlace mode is changing for some reason. For exactly-same caps the video encoder base class already ignores this. I think vp8enc and other encoder subclasses should check for this themselves, as we can't do this in the baseclass because for some codecs reconfiguration might be needed if the interlace mode changes.
Oleksij, what fixed this, or when/where was it fixed?
It was fixed here https://bugzilla.gnome.org/show_bug.cgi?id=747728
*** This bug has been marked as a duplicate of bug 747728 ***