NVIDIA Tegra
DRIVE 5.0 Linux Open Source Software

Development Guide
5.0.10.3 Release


 
Image Play (nvmimg_play)
 
Command Line Options
Required Commands
Optional Commands
Examples
Basic Playback
Display Option Examples
Playback Duration Examples
This topic describes how to use the nvmimg_play sample application for stream decoding. The sample supports the following bitstream types:
H.264
H.265
Command Line Options
The following shows the command syntax.
$ ./nvmimg_play [options]
Required Commands
The following table describes the required command line arguments.
Option
Parameter
Description
-c
[codec_type]
Specifies numeric or textual codec type. You can specify it with integers:
1: H.264
2: H265
Or with strings:
h264
h265
-f
[input_file]
Specifies the input file to decode.
Optional Commands
The following table describes the optional command line arguments.
Option
Parameter
Description
-r
[frame_rate]
Specifies the frame rate, in frames per second.
-n
[frame_number]
Specifies the minimum number of frames to decode. Default: Whole stream.
-s
[output_file]
Specifies a filename where output YUV is saved.
-v
[logging_level]
Specifies verbose logging. Higher logging levels also include the lower-level logging messages.
0: Errors (default)
1: Warnings
2: Info
3: Debug
-d
[display_id]
Specifies the display ID. Default: No display.
-w
[window_id]
Specifies the window ID. Default: 1.
-p
[window_position]
Specifies the display window position, in pixels. Default: full screen. Input format:
x0:y0:width:height
-z
[window_depth]
Specifies window depth. Permissible values are [0-255]. Default: 1.
-h
N/A
Prints usage and help information.
-id
[instance_id]
Specifies nvdec instance id to be used for decoding. Permissible values are 0 and 1. Default: 0
Examples
The nvmimg_play application performs stream decoding. It can display decoded frames on the screen (playback) and/or save decoded frames to an output YUV file. This section provides examples on how to run the application.
Basic Playback
The following command starts a playback of the disney.264 file on window ID 0.
$ ./nvmimg_play -c 4 -f disney.264 -d 0
Display Option Examples
This section provides two examples of display option usage.
Display Window Manipulation
This command is an example of display window manipulation:
$ ./nvmimg_play -c 4 -f disney.264 -d 0 -w 2 -z 20 -p 100:200:500:600
In this example:
Playback starts on display ID 0.
Window number is 2.
Position is:
x0=100
y0=200
width=500
height=600
Window depth is set to 20 (depth range is 0-255).
Save Decoded Frames to Output File
$ ./nvmimg_play -c 4 -f disney.264 -s disney_out.yuv
This example decodes the disney.264 stream and saves the decoded frames to the disney_out.yuv file.
Playback Duration Examples
Number of Frames to Decode
$ ./nvmimg_play -c 4 -f disney.264 -d 0 -n 100
This example streams to display ID 0 the first 100 frames from the disney.264 file.
Number of Loops
$ ./nvmimg_play -c 4 -f disney.264 -d 0 -l 10
This example plays disney.264 10 times and streams the video to display ID 0.