Video Demo (nvmvid_play)

This topic describes how to use the Video Demo sample application, nvmvid_play, for stream decoding. The application supports these stream types:
MPEG
MPEG-4
VC1
H.264
H.265
VP8
VP9

Command Line Switches

The application’s command syntax is:
./nvmvid_play [switches]
Required Commands

Required Switches

This table describes the required command line switches:
Switch
Description
-c <codec_type>
Specifies the codec type. You can specify the type with an integer or a string:
1 or mpeg: MPEG
2 or mpeg4: MPEG-4
3 or vc1: VC1
4 or h264: H.264
5 or vp8: VP8
6 or h265: H265
7 or vp9: VP9
-f <input_file>
Specifies the input file to decode.

Other Switches

This table describes the optional command line switches:
Switch
Description
Default
-t
Displays decode timing information. Default: Not displayed.
Information is not displayed.
-r <frame_rate>
Specifies the frame rate in frames/second.
N/A
-n <frames>
Specifies the minimum number of frames to decode.
Decodes the whole stream.
-l <loops>
Specifies the number of decode loops.
1
-s <output_file>
Specifies the output YUV file name.
No file is written.
-I <mode>
Specifies deinterlacing mode. The value may be:
0: Off
1: BOB
2: Advanced—frame rate
3: Advanced—field rate
0
-ia <algorithm>
Specifies the deinterlacing algorithm. This parameter is used only for advanced de-interlacing modes. The value may be:
1: Advanced1
2: Advanced2
1
-id <instance_id>
Specifies the nvdec instance ID to use for decoding. The value may be 0 or 1.
0
-it
The application uses Inverse-Telecine.
Off
-fq <filter_quality>
Specifies the filter quality. The value may be:
1: Low
2: Medium
3: High
2
-a <aspect_ratio>
Specifies the video stream’s aspect ratio.
N/A
-v <level>
Specifies the logging level. The value may be:
0: Errors
1: Warnings
2: Info
3: Debug
0
-h
Prints help text for the application.
 
-crc <gen/chk>
Enable CRC checks (chk) or generate CRC file (gen)
False
-crcpath <path>
Path for crc of the picture
Null
-cropcrc
CRC will be calculated on actual resolution
False

Examples

The nvmvid_play application can be used for stream decoding. Decoded frames can be saved to an output YUV file. This section provides several usage scenarios.
To perform decoding without saving decoded output
Enter this command:
./nvmvid_play -c 4 -f disney.264
This command starts decoding of the disney.264 H.264 stream and does not save the output YUV to a file.
To perform decoding and save decoded output
Enter this command:
./nvmvid_play -c 4 -f disney.264 -s disney_out.yuv
This command starts decoding of the disney.264 H.264 stream and saves the decoded frames to the disney_out.yuv file.
To perform BOB deinterlacing
Enter this command:
./nvmvid_play -c 1 -f HQV_Jaggies1.m2v -i 1
This example performs BOB deinterlacing on the decoded content.
Deinterlacing
To select field-rate mode with advanced 2 deinterlacing, enter this command:
./nvmvid_play -c 1 -f HQV_Jaggies1.m2v -i 3 -ia 2
To select field-rate mode with advanced 1 deinterlacing + inverse-telecine, enter this command:
./nvmvid_play -c 1 -f HQV_Jaggies1.m2v -i 3 -ia 1 -it
To select frame-rate mode with advanced 2 deinterlacing, enter this command:
./nvmvid_play -c 1 -f HQV_Jaggies1.m2v -i 2 -ia 1
To specify the number of frames to decode
To specify the number of frames to decode, enter this command:
./nvmvid_play -c 4 -f disney.264 -n 100
This example decodes the first 100 frames from the disney.264 file without saving the output to a file.
To specify the number of times to decode the frames, enter this command:
./nvmvid_play -c 4 -f disney.264 -l 10
This example decodes disney.264 ten times.
To generate CRC for decoded YUV
Enter this command:
./nvmvid_play -c 4 -f disney.264 -crc gen -crcpath disney_PitchLinear_Ref_CRC.txt
This example decodes the stream disney.264 and generates CRC of the decoded YUV and saves it into the given file disney_PitchLinear_Ref_CRC.txt.
To check CRC for decoded YUV against a reference CRC
Enter this command:
./nvmvid_play -c 4 -f disney.264 -crc chk -crcpath disney_PitchLinear_Ref_CRC.txt
This example decodes the stream disney.264 and computes CRC of the decoded YUV and compares it with the reference CRC disney_PitchLinear_Ref_CRC.txt.
It will print whether the CRC matches to the reference. If there is a mismatch, then the decoding is incorrect.
To get the decode timing information
Enter this command:
./nvmvid_play -c 4 -f disney.264 -t
This example decodes the stream disney.264 and prints the information of the average time taken per frame and the total time taken for the sequence.