GNOME Bugzilla – Bug 768921
Avformat demuxer
Last modified: 2018-01-13 11:24:52 UTC
Hello, i try to save stream to file i use next command: gst-launch-1.0 souphttpsrc location="http://109.104.129.134:8001/1" ! tsparse ! filesink location=out.ts , stream saved to file successfully. After that i want to convert this file to mp4 for example i use next command: GST_DEBUG=3 gst-launch-1.0 filesrc location=out.ts ! tsdemux name=decode ! queue ! h264parse ! decodebin ! videoconvert ! x264enc ! queue ! mp4mux name=mux ! filesink location=out.mp4 decode. ! queue ! aacparse ! decodebin ! audioconvert ! queue ! faac ! queue ! mux. but conversion failed logs: 0:00:00.016017828 2629 0xffc690 WARN basesrc gstbasesrc.c:3488:gst_base_src_start_complete:<filesrc0> pad not activated yet Pipeline is PREROLLING ... 0:00:00.018340278 2629 0xfecde0 WARN mpegtsbase mpegtsbase.c:1329:mpegts_base_scan:<decode> Couldn't find any PCR within the first 655360 bytes 0:00:00.018488638 2629 0xfecde0 WARN mpegtsbase mpegtsbase.c:1388:mpegts_base_loop:<decode> error: Internal data stream error. 0:00:00.018498493 2629 0xfecde0 WARN mpegtsbase mpegtsbase.c:1388:mpegts_base_loop:<decode> error: stream stopped, reason error ERROR: from element /GstPipeline:pipeline0/GstTSDemux:decode: Internal data stream error. Additional debug info: mpegtsbase.c(1388): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:decode: stream stopped, reason error ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Also for this file i try to convert via avconv commands looks like: avconv -i out.ts -c:v libx264 -c:a copy out.mp4 and after processing receive normally playable file. File you can find in attachment. Note: file you can play only if enable Avformat demuxer in vlc demuxer properties. http://gstreamer-devel.966125.n4.nabble.com/file/n4678696/out.ts
I do wget -O 768921.ts http://109.104.129.134:8001/1 Download 20MB or so. Afterwards, neither VLC nor gstreamer can play the file, so I'm tempted to say there's something wrong with the original stream. You say we need to force the avformat demuxer in vlc to make it work, but I think it's likely really just an indication that the stream isn't quite right. I don't know if anyone here wants to debug your stream :)
Please use avdemux_mpegts.
i added this code: AVIOContext* pb = NULL; int res = avio_open_dyn_buf(&pb); if (res == 0) { res = ff_isom_write_avcc(pb, context->extradata, context->extradata_size); if (res == 0) { uint8_t* out = NULL; int len = avio_close_dyn_buf(pb, &out); GstBuffer *data = gst_buffer_new_and_alloc (len); gst_buffer_fill (data, 0, out, len); gst_caps_set_simple(caps, "codec_data", GST_TYPE_BUFFER, data, NULL); gst_buffer_unref (data); av_free(out); } } how i can understand libav internal data which placed in context->extradata not in avc format, i convert it, and after that stream conversion worked as needed.
Sorry, I don't really understand what this bug is about exactly, so I'm going to close it to reduce clutter. Please feel free to attach a proper patch in git format-patch format and re-open.