teltek / gst-plugin-ndi

GStreamer NDI Plugin for Linux
GNU Lesser General Public License v2.1
154 stars 27 forks source link

Is it possible to give an example of saving the ndi stream to an mp4 or so #70

Open f1-outsourcing opened 2 years ago

f1-outsourcing commented 2 years ago

I am new to gstreamer, would be nice to have some example that saves to an mp4.

Currently I am testing with this, and that just generates a 100MB/s file

gst-launch-1.0 -v ndivideosrc url-address="192.168.0.215:5961" ! filesink location=test.raw

[@test /]# mediainfo test.raw
General
Complete name                            : test.raw
File size                                : 214 MiB
normen commented 2 years ago

It depends on your source and what encoders are available on your system. On MacOS I do this to do hardware-encoding of NDI sources: gst-launch-1.0 ndivideosrc ndi-name='NDI Source Name' ! queue ! videoconvert ! vtenc_h264 ! queue ! h264parse ! mpegtsmux ! filesink location='ndi-source.ts'

normen commented 2 years ago

Heres an updated example for the latest versions, saves a NDI stream as h264 TS using hardware encoding on a NVidia GPU:

gst-launch-1.0 ndisrc ndi-name="NDI Source" ! ndisrcdemux name=demux   demux.video ! queue ! nvh264enc ! h264parse ! mpegtsmux name=muxer ! filesink location="NDI-Source.ts"  demux.audio ! queue ! audioconvert ! avenc_aac ! aacparse ! muxer.
sdroege commented 2 years ago

You probably want to use avenc_aac instead of faac. The latter produces low quality AAC.