Pipeline stuck at calling create offset 18446744073709551615 length 4096, time 0 ?
Craig Carnell
craig_carnell at hotmail.com
Fri Mar 3 17:10:41 UTC 2023
Dear all,
I am writing a pipeline that processes a single demuxed packet at a time, send its to decodebin then returns the decoded sample for rendering later.
I am using appsrc->decodebin->videoconvert->appsink.
However, after pushing the single buffer (1 frame) it seems to get stuck, their is no debug output past this line in my terminal:
"0:00:03.999976453 48662 0x7f5a440238c0 LOG basesrc gstbasesrc.c:2902:gst_base_src_loop:<video_src> next_ts 99:99:99.999999999 size 4096
0:00:03.999981012 48662 0x7f5a440238c0 DEBUG basesrc gstbasesrc.c:2579:gst_base_src_get_range:<video_src> calling create offset 18446744073709551615 length 4096, time 0
"
I have attached a pastebin of GST_DEBUG (as much as can fit in a pastebin) as well as the sample code which I've included below.
Please see code:
GError* error = nullptr;
if(!gst_init_check(nullptr, nullptr, &error)) {
CLog::Log(LOGERROR, "CDVDVideoCodecGStreamerWrapper(): gst_init_check() failed: {}", error->message);
g_error_free(error);
}
data.input_caps = gst_ffmpeg_codecid_to_caps(hints.codec, m_pCodecContext, true);
/* Input_caps_char resolves to: video/x-h264, width=(int)1920, height=(int)1080, framerate=(fraction)29/1, alignment=(string)au, stream-format=(string)avc, codec_data=(buffer)01640028ffe1002e67640028ac2ca401e0089f97ff0001000152020202800001f48000753070100016e36000089545f8c7076858b44801000568eb735250fdf8f800 */
std::string pipeline = "appsrc name=video_src ! "
+ std::string(input_caps_char)
+ " ! decodebin name=my_decoder"
+ " ! videoconvert name=video_convert"
+ " ! videoscale"
+ " ! appsink name=app_sink";
data.pipeline = gst_parse_launch(pipeline.c_str(), &error);
g_object_set(G_OBJECT(data.app_source),
"stream-type", 0, // stream-type is stream or seekable for push mode
"format", GST_FORMAT_TIME, // GST_FORMAT_TIME for timestamped buffers
"is-live", true,
nullptr);
m_bus = gst_pipeline_get_bus(GST_PIPELINE (data.pipeline));
gst_bus_add_watch(m_bus, (GstBusFunc)CBBusMessage, this);
g_object_set(data.app_sink, "emit-signals", true, nullptr);
ret = gst_element_set_state(data.pipeline, GST_STATE_PLAYING);
main_loop = g_main_loop_new(nullptr, false);
In my push buffer function, packet.pData contains a single encoded packet:
GstFlowReturn ret;
GstBuffer * buffer = gst_buffer_new_allocate(NULL, packet.iSize, NULL);
gst_buffer_fill(buffer, 0, packet.pData, packet.iSize);
GST_BUFFER_DTS (buffer) = (packet.dts == DVD_NOPTS_VALUE)
? GST_CLOCK_TIME_NONE
: static_cast<int64_t>(packet.dts / DVD_TIME_BASE * AV_TIME_BASE);
GST_BUFFER_PTS (buffer) = (packet.pts == DVD_NOPTS_VALUE)
? GST_CLOCK_TIME_NONE // gst_ffmpeg_time_ff_to_gst??
: static_cast<int64_t>(packet.pts / DVD_TIME_BASE * AV_TIME_BASE);
// first packet - DTS is GST_CLOCK_TIME_NONE (18446744073709551615), pts is 0
g_signal_emit_by_name(data.app_source, "push-buffer", buffer, &ret);
gst_buffer_unref(buffer);
In my pull sample function:
g_signal_emit_by_name(data.app_sink, "pull-sample", &sample);
This never passes this point.
GST_DEBUG=6
https://pastebin.com/CsVsdTDh
The complete code is here:
https://github.com/xbmc/xbmc/blob/243b985c6841bb829eb399ab894fe6b2eace2ff1/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecGStreamer.cpp
Any ideas?
Thanks,
Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230303/746df148/attachment-0001.htm>
More information about the gstreamer-devel
mailing list