Use of the NVIDIA Jetson Nano for DATV

Digital ATV - The latest generation, cutting edge ATV - Please discuss it all here.
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.

Thank you
m0vse
Posts: 18
Joined: Thu Nov 21, 2019 11:55 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by m0vse » Fri Nov 22, 2019 11:38 pm

G4WIM wrote:
Fri Nov 22, 2019 9:13 pm
Hi 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
Hi Tim, the source streamer is one of these https://www.ebay.co.uk/itm/H-265-H-264- ... 2749.l2649

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
Here is the section that I created which outputs a test screen (smtpe) along with a 420hz tone.

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

m0vse
Posts: 18
Joined: Thu Nov 21, 2019 11:55 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by m0vse » Fri Nov 22, 2019 11:55 pm

Hi Tim.

Here are the settings for the encoder. Only useful if you have the same device I suppose but it gives you an idea!
video.png
video.png (44.37 KiB) Viewed 4303 times
audio.png
audio.png (19.2 KiB) Viewed 4303 times
stream.png
stream.png (21.15 KiB) Viewed 4303 times
Here is the output with the LimeSDR connected directly (hence the rather high MER!)
minitioune.png
minitioune.png (236.99 KiB) Viewed 4303 times
I am simultaneously streaming to the BATC (using the same streamer). The image is an HTML template that I created of the BBC clock being played by a CasparCG server into a BMD Decklink card. The clock makes a useful latency test.

https://batc.org.uk/live/m0vse

73 Phil M0VSE

G4WIM
Posts: 379
Joined: Thu Jan 29, 2015 8:36 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by G4WIM » Sat Nov 23, 2019 10:02 am

Hi Phil

I forgot to say welcome to the forum !

Thanks for the info very interesting indeed.

I had seen that encoder on ebay and wondered if it would be any better timing wise than the LKV373 I currently use, maybe it uses the same chipset ?

When using the LKV373A I get quite a few PCR / DTS errors resulting in dropped frames - maybe this encoder will be better ??

Specifically if I start the nano from a shell script for a specific set of parameters which includes an IP source, it takes a while to get sync and settle down but there's always residual PCR DTS errors.

I wonder if this ebay encoder shows the same symptoms ?

How do you change freq, symbol rate and FEC ? I use Portsdown code on an RPI.

Sorry for all the questions but this is a bug I've been chasing down for time as I like using the RPI and Jetson Nano because it has low latency and is easy to change parameters etc.

73 Tim

edit - that BlackMagic ATEM looks like a nice bit of kit and perhaps works better than a PC based solution as I suspect my Nvidia video card timings are not quite right. I had to set a custom front porch to improve stability with the LKV373 otherwise eventually the Nano output freezes as it looses sync with the incoming IP stream from the LKV.

Just bought the last encoder from that link on ebay !

m0vse
Posts: 18
Joined: Thu Nov 21, 2019 11:55 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by m0vse » Sat Nov 23, 2019 11:06 am

Hi Tim.

Yes I find that gstreamer does take a while to sync to the stream but it is only a few seconds... I haven't noticed any DTS errors while I have been running it, I did get a lot before I worked out that it needs to decode AAC audio which does suggest that the stream is not quite right?

I have ordered an LKV373 so should be able to compare the two.

I manually set the freq, symbol rate, FEC etc manually in the jetson_nano.sh script so not sure how you would do that on the RPi?

Latency is always important for me (one of the things that I do in my day job is controlling big screens in sports stadiums) so I always try to use equipment that introduces minimum latency. The ATEM has a maximum latency of 1 frame (less if all devices are synced) and so far the streamer seems to introduce less than 1 second latency so not bad really.

I have also been playing with ex-broadcast equipment and I have an Ericsson MPEG4 encoder and an SED DVB-S2 modulator and get similar results latency wise with these!

73 Phil M0VSE

G4WIM
Posts: 379
Joined: Thu Jan 29, 2015 8:36 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by G4WIM » Thu Dec 05, 2019 8:20 pm

Hi Phil,

I sent you a PM about my experiences with the ebay encoder and your settings - subsequently I've got it working by running it from a script on the nano but am still seeing lots of dts < pcr TS invalid messages which result in dropped frames.

This is the same behavoir I see with the LKV373 so I suspect the root cause is my video card in the PC.

Have you any thoughts on this matter ?

73 Tim

g0mjw
Posts: 2330
Joined: Sat Sep 20, 2014 9:15 am

Re: Use of the NVIDIA Jetson Nano for DATV

Post by g0mjw » Thu Dec 05, 2019 9:08 pm

Check your PCRPTS setting is long enough - that can be a problem.

Mike

G4WIM
Posts: 379
Joined: Thu Jan 29, 2015 8:36 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by G4WIM » Thu Dec 05, 2019 9:46 pm

Hi Mike,

thanks for that hint - how might I tweak PCRPTS setting is it a Nvidia setting on the PC ?

Regards Tim

g0mjw
Posts: 2330
Joined: Sat Sep 20, 2014 9:15 am

Re: Use of the NVIDIA Jetson Nano for DATV

Post by g0mjw » Thu Dec 05, 2019 9:53 pm

Is should be in the nano script PCR_PTS=?

G4WIM
Posts: 379
Joined: Thu Jan 29, 2015 8:36 pm

Re: Use of the NVIDIA Jetson Nano for DATV

Post by G4WIM » Thu Dec 05, 2019 10:02 pm

ok found it, currently set to 200000

Another variable to mess with ;-)

73 Tim

g0mjw
Posts: 2330
Joined: Sat Sep 20, 2014 9:15 am

Re: Use of the NVIDIA Jetson Nano for DATV

Post by g0mjw » Thu Dec 05, 2019 10:19 pm

Mine was set to 1000000

Post Reply

Return to “DATV - Digital ATV”