I am currently working on writing a application for internet radio. I am using gstreamer to do all the playing and streaming. My pipeline currently only consists of a playbin. When I try to play URIs such as https://mtist.as.smartstream.ne.jp/30062/livestream/playlist.m3u8 or https://mtist.as.smartstream.ne.jp/30068/livestream/playlist.m3u8, I get the warning WARN mpegtspacketizer mpegtspacketizer.c:2334:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp. Also when I try to play those URIs no audio is played.
I have tried playing those URIs in vlc and they do work. I have done some research on how to fix this. One post online suggests that using the element tsparse with the option set-timestamps=true set would fix it. However when testing with gst-launch-1.0 it does not work. (pipeline used with gst-launch-1.0: souphttpsrc ! hlsdemux ! tsparse set-timestamps=true ! tsdemux ! aacparse ! faad ! audioconvert ! autoaudiosink)
#include <gstreamer-1.0/gst/gst.h>
#include <stdlib.h>
/*
cc `pkg-config --cflags gstreamer-1.0` ./quick_mrb.c -o ./mrb `pkg-config --libs gstreamer-1.0`
to see errors/warnings run with GST_DEBUG=2
*/
int main(int argc, char* argv[]) {
gst_init(&argc, &argv);
GMainLoop* mainloop;
GstElement* pipeline;
pipeline = gst_element_factory_make("playbin", NULL);
gst_element_set_state(pipeline, GST_STATE_READY);
g_object_set(pipeline, "uri", "https://mtist.as.smartstream.ne.jp/30062/livestream/playlist.m3u8", NULL);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
return 0;
}