Hello evryone,
I am trying to transcode mpegts stream from web camera into multibitrate hls stream similar to youtube.
Since FFmpeg is not fully supported on jetson platform I am using Gstreamer. So far this is what I managed to put together:
gst-launch-1.0 souphttpsrc location="http://192.168.0.22/mpegts" ! progressreport ! decodebin ! multiqueue ! nvvidconv ! deinterlace ! tee name=t ! queue ! "video/x-raw(memory:NVMM),width=1280,height=720" ! omxh264enc control-rate=1 bitrate=3000000 preset-level=3 profile=8 ! video/x-h264 ! h264parse ! mpegtsmux ! hlssink location="720-%05d.ts" playlist-location="720.m3u8" t. ! queue ! "video/x-raw(memory:NVMM),width=1280,height=720" ! omxh264enc control-rate=1 bitrate=1500000 preset-level=3 profile=8 ! video/x-h264 ! h264parse ! mpegtsmux ! hlssink location="360-%05d.ts" playlist-location="360.m3u8"
This snippet takes mpegts stream, deinterlaces it and encodes into two different bitrates. All would be good, but as you have probably already noticed size of the image is same for both outputs (1280x720) and if changed to be different it stops working. Snippet can be modified to produce any resolution only as long as both are the same. If I set second output to 640 by 360 script throws following errors repeated multiple times:
(gst-launch-1.0:24465): GStreamer-CRITICAL **: 18:24:52.672: gst_mini_object_copy: assertion 'mini_object != NULL' failed
(gst-launch-1.0:24465): GStreamer-CRITICAL **: 18:24:52.673: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:24465): GStreamer-CRITICAL **: 18:24:52.673: gst_structure_copy: assertion 'structure != NULL' failed
(gst-launch-1.0:24465): GStreamer-CRITICAL **: 18:24:52.673: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed
Any help is highly appreciated.