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 768921 - Avformat demuxer
Avformat demuxer
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-libav
1.6.2
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-18 13:15 UTC by atopilski@gmail.com
Modified: 2018-01-13 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description atopilski@gmail.com 2016-07-18 13:15:32 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
Comment 1 Tim-Philipp Müller 2016-07-18 13:30:19 UTC
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 :)
Comment 2 atopilski@gmail.com 2016-07-22 11:37:22 UTC
Please use avdemux_mpegts.
Comment 3 atopilski@gmail.com 2016-07-25 14:31:25 UTC
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.
Comment 4 Tim-Philipp Müller 2018-01-13 11:24:52 UTC
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.