Image Play (nvmimg_play)
This topic describes how to use the Image Play sample application, nvmimg_play, for stream decoding. The application supports the following bitstream types:
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:
Specifies numeric or textual codec type. You can specify it with integers:
1: H.264
2: H265
Or with strings:
Specifies the input file to decode.
Optional Options
This table describes the optional command line arguments:
-r <frame_rate>
Specifies the frame rate, in frames/second.
-n <frame_number>
Specifies the minimum number of frames to decode.
-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
-d <display_id>
Specifies the display ID.
No display
-w <window_id>
Specifies the window ID.
-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].
Prints usage and help information.
-id <instance_id>
Specifies the nvdec instance id to be used for decoding. Value may be 0 or 1.
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.