Can nvgstplayer play video without X11 environment?

Hi

I have been developing media display using raspi.
I would like to explore using jetson nano for my project, hopefully to incorporate some AI components to the media display

At raspi, I am using omxplayer at raspi which allow me to play video without the X11 desktop environment.

May I know whether nvgstplayer can do that?

I would appreciate it if someone could point me to the right resource to investigate… I have been reading through the forum but could not find similar topic.

Many thanks in advance

Regards,
James

Hi,
Please utilize nvoverlaysink:

$ nvgstplayer-1.0 -i file:///home/nvidia/deepstream_sdk_v4.0.1_jetson/samples/streams/sample_720p.mp4 <b>--svs=nvoverlaysink</b>

Thanks DaneLL

the command works. But it is full-screen

I tried
nvgstplayer-1.0 -i file:///home/nvidia/deepstream_sdk_v4.0.1_jetson/samples/streams/sample_720p.mp4 --svs=nvoverlaysink --window-x 0 --window-y 0 --window-width 1024 --window-height 768

it still show fullscreen. Anyway to specify the display area?

James

Hi,
For this function, you need to customize nvgstplayer-1.0 to use nvdrmvideosink. nvdrmvideosink has the properties:

offset-x            : Sets offset x
                    flags: readable, writable
                    Integer. Range: 0 - 2147483647 Default: 0
offset-y            : Sets offset y
                    flags: readable, writable
                    Integer. Range: 0 - 2147483647 Default: 0

Source code of nvgstplayer-1.0 is in
https://developer.nvidia.com/embedded/r32-2-3_Release_v1.0/Sources/T210/public_sources.tbz2
Please follow README to build/run the app.

@DaneLLL

Thanks for the prompt response. Great support from Nvidia

@DaneLLL

I am a GStreamer NOOB.

I downloaded the public_sources.tbz2 and found nvgstplayer-1.0_README.txt. It is to give instruction on how to compile the nvgstplayer-1.0 for armhf and the command syntax.

I totally got no clue how to customise the source code “nvgstplayer.c”. Would appreciate it if you could give some clues / instructions on how to go about customising the nvgstplayer app.

how do i incorporate

gst_video_overlay_set_render_rectangle
(GstVideoOverlay *overlay,
gint x,
gint y,
gint width,
gint height);

into :

if (GST_IS_VIDEO_OVERLAY (vsink)) {
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (vsink),
(gulong) window);
gst_video_overlay_expose (GST_VIDEO_OVERLAY (vsink));
}

Many thanks

James

Hi,
It is open source and we would encourage users on customization and integration. Please check

nvgstapps_src\README.txt

Hi DaneLLL

I tried the following and gotten success.

gst-launch-1.0 filesrc location=video5.mp4 !
qtdemux name=demux ! h264parse ! omxh264dec !
nvvidconv flip-method=0 !
‘video/x-raw(memory:NVMM), width=1280 height=720 format=(string)I420’ !
nvdrmvideosink conn_id=0 plane_id=1 set_mode=0 offset-x=100 offset-y=100 -e

I am still trying to figure out how to port the above pipeline (render chain) using nvgstplayer-1.0.

What are the key differences between nvgstplayer-1.0 and gst-launch-1.0? Is there any advantage to play the video in nvgstplayer-1.0?

Also, would appreciate it if you could point me to the documentation of nvoverlaysink and nvdrmvideosink. I would like to explore what are the properties available … many thanks

James

Hi,
nvgstplayer-1.0 is a reference app to demonstrate how to program gstreamer pipelines in C code. If gst-launch-1.0 is good in your usecase, you may run simply run gst-launch-1.0 commands.

You may check gstreamer user guide for more sample pipelines:
https://developer.nvidia.com/embedded/dlc/l4t-accelerated-gstreamer-guide-32-2

Hi DaneLLL

Thanks for the prompt reply. Will work on gst-launch-1.0.

Just to close the loop in case someone looking for the same solution:

working solution:
nvgstplayer-1.0 -i video5.mp4 --svs="nvvidconv # flip-method=1 ! nvoverlaysink # overlay-x=100 # overlay-y=100 # overlay-w=720 # overlay-h=1280 "

I could not get the nvdrmvideosink to work the same way …

Cheers,
James

@DaneLLL

I tried the following audio decode example given in the gstreamer user guide, but could not get audio.

Any pointers on what could possibly went wrong?

gst-launch-1.0 filesrc location=video1.mp4 !
qtdemux name=demux demux.audio_0 !
queue ! avdec_aac ! audioconvert ! alsasink -e

I could play the mp4 file with audio using the following:
nvgstplayer-1.0 -i video1.mp4 --svs=nvoverlaysink

I tried all the audio decode examples in the guide using gst-launch-1.0 and could not get any audio.

Hi,
You can run ‘aplay -l’ to list all audio playback devices and set it to alsasink like:

$ gst-launch-1.0 filesrc location=a.mp4 ! qtdemux ! avdec_aac ! audioconvert ! alsasink device="hw:2,0"

Hi DaneLLL

Thanks for the help. I managed to piece together the gst-launch-1.0 pipeline together. But I got the following error messages. I googled them but seems like it is a bug…

gst-launch-1.0 filesrc location=video1.mp4 !
qtdemux name=demux
demux.audio_0 ! queue !
avdec_aac ! audioconvert !
alsasink device=“hw:0,3”
demux.video_0 ! queue !
h264parse ! omxh264dec !
nvvidconv flip-method=0 !
‘video/x-raw(memory:NVMM), width=1280, height=720, format=(string)I420’ !
nvdrmvideosink conn_id=0 plane_id=1 set_mode=0 offset-x=100 offset-y=100

===========================

Setting pipeline to PAUSED …
Pipeline is PREROLLING …

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_caps_is_empty: assertion ‘GST_IS_CAPS (caps)’ failed

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_caps_truncate: assertion ‘GST_IS_CAPS (caps)’ failed

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_caps_fixate: assertion ‘GST_IS_CAPS (caps)’ failed

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_caps_get_structure: assertion ‘GST_IS_CAPS (caps)’ failed

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_structure_get_string: assertion ‘structure != NULL’ failed

(gst-launch-1.0:5571): GStreamer-CRITICAL **: 18:00:46.114: gst_mini_object_unref: assertion ‘mini_object != NULL’ failed
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Allocating new output: 1280x720 (x 12), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3605: Send OMX_EventPortSettingsChanged: nFrameWidth = 1280, nFrameHeight = 720
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstAudioSinkClock

solved. replaced “omxh264dec” with "nvv4l2decoder ". But I do not know why. Maybe you can enlighten me. For learning purpose.

Many thanks

=========================
gst-launch-1.0 filesrc location=video1.mp4 !
qtdemux name=demux
demux.audio_0 ! queue !
avdec_aac ! audioconvert !
alsasink device=“hw:0,3”
demux.video_0 ! queue !
h264parse !
nvv4l2decoder !
nvvidconv flip-method=0 !
nvoverlaysink
overlay-x=100 overlay-y=100 overlay-w=1280 overlay-h=720

==================
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is PREROLLING …
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstAudioSinkClock
Got EOS from element “pipeline0”.
Execution ended after 0:04:21.438113040
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Hi,
We are deprecating omx plugins, so if nvv4l2decoder works fine, please use it.

@DaneLLL

I have a dell-G7 with GTX1060.
I installed gstreamer on it but realised that it does not come with nvidia’s plugins.

May I know whether these nvidia plugins (which came with jetpack4.3) can be used on my dell-G7 with GTX1060, and if yes how I could install those gst plugins on my dell-G7?

Hi,
For PC with NVIDIA desktop GPU, please use video codec SDK to leverage hardware acceleration.

nvgstplayer is for Jetson platforms.

@DaneLLL

Seems like the nvidia-video-codec sdk is based on FFMPEG.
Is there a GStreamer based sdk for Nvidia desktop GPU?