sdroege / gstreamer-rs

GStreamer bindings for Rust - This repository moved to https://gitlab.freedesktop.org/gstreamer/gstreamer-rs
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs
Other
521 stars 64 forks source link

Request for mpegtsmux example #175

Closed SonnyWalkman closed 3 years ago

SonnyWalkman commented 3 years ago

I'm putting together a tsmuxer for a DATV project. (Digital Amateur TV) similar to IPTV.

I was hoping there was a rust example with using the gstreamer mpegtsmux element to show its full glory.

The later releases 1.18.4 indicates a lot of work done yo get mpegtsmux DVB compliant supporting most of the SI tables, PMT, NIT, PAT and CBR!! Only FFMPEG or opencaster was the only ones available in freeware.

There are a few mpegtsmux examples in C however nothing in rust.

Here's an example using gst-launch-1.0 however limited to the fact you can't set pat-interval, pmt-interval etc.. I maybe wrong?

gst-launch-1.0 -v filesrc location=/media/myfile.ts ! tsdemux name=demux program-number=10 demux.video_012c ! queue ! mux.sink_300 mpegtsmux name=mux prog-map=program_map,sink_300=10,sink_302=10,sink_303=10,sink_301=10 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=8000 demux.metadata_012f ! queue ! mux.sink_303

And

gst-launch-1.0 -vm --gst-plugin-path=./gstreamer-media-SDK/build/gst/mfx videotestsrc is-live=true pattern=zone-plate kx2=20 ky2=20 kxy=4 kt2=10 ! queue ! video/x-raw, format=I420,width=1280,height=720 ! queue ! videoconvert ! queue ! mfxhevcenc rate-control=cbr bitrate=10000 gop-size=32 idr-interval=1 async-depth=1 gop-distance=4 ! queue ! mux.sink_100 mpegtsmux name=mux prog-map=program_map,sink_100=1 ! queue ! tsparse ! queue ! udpsink name=udpsink port=1234 host=239.141.50.1 max-bitrate=120000000

Furthermore, has anyone muxed in a teletext stream using appsrc with Pad template application/x-teletext: ?

Love to know how you got it to work. I tried however just couldn't get it to work maybe need constant time stamping to Video PCR.

A rust example for both would be appreciated. 😁

sdroege commented 3 years ago

The canonical location of the repository is at https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues , so I'm closing this issue here. As this is more a support request than an issue, please ask on the mailing list: https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

There are a few mpegtsmux examples in C however nothing in rust.

You're looking for the usage of the API from libgstmpegts from Rust? There are only unsafe FFI bindings for that library currently, mostly because the API is very bindings unfriendly.

You can write your application as usual with Rust and the bindings, and for accessing the API of that library you'd need to use some unsafe code. That would then basically look like the C code you linked, plus the relevant translations between Rust and C types.

Does this help answering your question?

Furthermore, has anyone muxed in a teletext stream using appsrc with Pad template application/x-teletext: ?

What problems are you running into?