Hi Tim, the source streamer is one of these https://www.ebay.co.uk/itm/H-265-H-264- ... 2749.l2649G4WIM wrote: ↑Fri Nov 22, 2019 9:13 pmHi Phil,
interesting work - any chance you could post your settings for the video source streamer (OBS or Vmix ?) and the tweaks you made to nanoencode.sh ?
I'm currently using OBS + LKV373 + Nano + Lime works ok most of the time but the output from my PC seems to upset the LKV at times but by tweaking the video card parameters I can make it run fairly well only dropping the odd frame every 20 seconds or so.
73 Tim
I tend to prefer hardware devices so don't use OBS or Vmix, I do all of my video switching with a Blackmagic ATEM.
Here are the relevant parts of my modified nanoencode.sh:
This line accepts the UDP multicast H.265 stream and outputs it (should be one long line). As the streamer allows pretty accurate setting of the bitrate for video and audio, I am currently experimenting with outputting it directly without transcoding which should be much more efficient.
Code: Select all
"H265")
gst-launch-1.0 udpsrc multicast-group=$VIDEOSOURCE_IP_ADRESS port=$VIDEOSOURCE_IP_PORT ! video/mpegts ! tsdemux name=dem dem. ! queue ! h265parse ! omxh265dec ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)$VIDEO_RESX, height=(int)$VIDEO_RESY, format=(string)I420" ! omxh265enc control-rate=2 bitrate=$VIDEOBITRATE peak-bitrate=$VIDEOPEAKBITRATE preset-level=3 iframeinterval=$VIDEO_GOP ! "video/x-h265,stream-format=(string)byte-stream" ! mux. dem. ! queue ! aacparse ! faad ! audioconvert ! audioresample ! 'audio/x-raw, format=S16LE, layout=interleaved, rate=48000, channels=1' ! voaacenc bitrate=$AUDIO_BITRATE ! queue ! mux. mpegtsmux alignment=7 name=mux ! fdsink | ffmpeg -i - -ss 8 -c:v copy -max_delay $PCR_PTS -muxrate $BITRATE_TS -c:a copy -f mpegts -metadata service_provider="QO-100" -metadata service_name=$CALL -streamid 0:256 $ffmpegoutput
Code: Select all
"VIDEOSOURCE_TEST")
case "$CODEC" in
"H264")
gst-launch-1.0 -q videotestsrc pattern=smpte ! "video/x-raw,width=1920, height=1080, format=(string)YUY2" ! nvvidconv flip-method=0 ! "video/x-raw(memory:NVMM), format=(string)I420" ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)$VIDEO_RESX, height=(int)$VIDEO_RESY, format=(string)I420" ! omxh264enc vbv-size=15 control-rate=2 bitrate=$VIDEOBITRATE peak-bitrate=$VIDEOPEAKBITRATE insert-sps-pps=1 insert-vui=1 cabac-entropy-coding=1 preset-level=3 profile=8 iframeinterval=$VIDEO_GOP ! "video/x-h264, level=(string)4.1, stream-format=(string)byte-stream" ! queue ! mux. audiotestsrc ! 'audio/x-raw, format=S16LE, layout=interleaved, rate=48000, channels=1' ! voaacenc bitrate=$AUDIO_BITRATE ! queue ! mux. mpegtsmux alignment=7 name=mux ! queue ! fdsink | ffmpeg -i - -ss 8 -c:v copy -max_delay $PCR_PTS -muxrate $BITRATE_TS -c:a copy -f mpegts -metadata service_provider="QO-100" -metadata service_name=$CALL -streamid 0:256 $ffmpegoutput
;;
"H265")
gst-launch-1.0 -v videotestsrc pattern=smpte ! "video/x-raw,width=1920, height=1080, format=(string)YUY2" ! nvvidconv flip-method=0 ! "video/x-raw(memory:NVMM), format=(string)I420" ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)$VIDEO_RESX, height=(int)$VIDEO_RESY, format=(string)I420" ! omxh265enc control-rate=2 bitrate=$VIDEOBITRATE peak-bitrate=$VIDEOPEAKBITRATE preset-level=3 iframeinterval=$VIDEO_GOP ! "video/x-h265,stream-format=(string)byte-stream" ! queue ! mux. audiotestsrc ! 'audio/x-raw, format=S16LE, layout=interleaved, rate=48000,channels=1' ! voaacenc bitrate=$AUDIO_BITRATE ! queue ! mux. mpegtsmux alignment=7 name=mux !queue max-size-time=10000000000 max-size-bytes=0 max-size-buffers=0 ! fdsink | ffmpeg -i - -ss 8 -c:v copy -max_delay $PCR_PTS -muxrate $BITRATE_TS -c:a copy -f mpegts -metadata service_provider="QO-100" -metadata service_name=$CALL -streamid 0:256 $ffmpegoutput
;;
*)
echo "Wrong codec" ;;
esac
;;
*)
73 Phil M0VSE