NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.12.0 Release


 
Image Play (nvmimg_play)
 
Command Line Options
Required Options
Optional Options
Examples
This topic describes how to use the Image Play sample application, nvmimg_play, for stream decoding. The application supports the following bitstream types:
H.264
H.265
The application can display decoded frames on the screen (playback) and/or save decoded frames to an output YUV file.
Command Line Options
The application’s command syntax is.
$ ./nvmimg_play [options]
Required Options
This table describes the required command line options:
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 Options
This table describes the optional command line arguments:
Option
Description
Default
-r <frame_rate>
Specifies the frame rate, in frames/second.
N/A
-n <frame_number>
Specifies the minimum number of frames to decode.
Unlimited
-s <output_file>
Specifies a file where output YUV is to be saved.
 
-v <level>
Specifies the logging level. Value may be:
0: Errors (default)
1: Warnings
2: Info
3: Debug
0
-d <display_id>
Specifies the display ID.
No display
-w <window_id>
Specifies the window ID.
1
-p <x0>:<y0>:<w>:<h>
Specifies the display window position and size, in pixels.
Full screen display
-z <window_depth>
Specifies the display window depth. Permissible values are [0,255].
1
-h
Prints usage and help information.
 
-id <instance_id>
Specifies the nvdec instance id to be used for decoding. Value may be 0 or 1.
0
Examples
This topic provides examples of how to run the application.
To perform basic playback
To start a playback of the disney.264 file on window ID 0, enter this command:
$ ./nvmimg_play -c 1 -f disney.264 -d 0
To manipulate the display window
This command illustrates display window manipulation:
$ ./nvmimg_play -c 1 -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.
The display window position is: x0=100, y0=200, width=500, height=600.
Window depth is 20.
To save decoded frames to an output file
Enter this command:
$ ./nvmimg_play -c 1 -f disney.264 -s disney_out.yuv
The command decodes the disney.264 stream and saves the decoded frames to the file disney_out.yuv.
To specify the number of frames to decode
Enter this command:
$ ./nvmimg_play -c 1 -f disney.264 -d 0 -n 100
The command streams the first 100 frames from the disney.264 file to display ID 0.
To specify the number of loops
Enter this command:
$ ./nvmimg_play -c 1 -f disney.264 -d 0 -l 10
The command plays disney.264 ten times and streams the video to display ID 0.