DM365 Demo Application
From Texas Instruments Embedded Processors Wiki
Contents |
DM365 Demo Applications
The demo applications are built to show basic device capability. The DM365 demo applications can be played using IR remote control or keyboard. There are three demo applications in DVSDK demo package for DM365; encode, decode and encodedecode.
The demos print the performance data on console, but there is also facility to print the performance data on OSD screen.
Decode
This demo uses the codec engine to decode data from files and output the uncompressed data using peripheral device drivers. Video and speech files are supported. All files must consist of raw encoded frames of data (elementary streams).
Implementation details
A brief implementation description of decode demo application is given below
- The video part of the application runs in two threads (video thread & display thread)
- The video thread reads data from file, gives the data to decoder to decode the frame and posts the decoded data to display thread
- The decoded video format is 420 semi planar
- The display thread reads the decoded data (posted by video thread), does a frame copy (DMA based frame copy) to display buffer and puts the display data to the driver for display
- The display thread also implements a rate control mechanism to run the loop at 30fps in case of 720P-60 output
- The speech part of the application runs in one thread, it reads the speech file from a file decodes it and posts the decoded data to audio driver for playout
Usage
decode [options...]
-v <video file>, --videofile <video file>
Decodes a video file. The demo detects which type of video file is supplied using the file extension.
Supported video algorithms are:
MPEG4 SP (.mpeg4 or .m4v extension)
H.264 HP (.264 extension)
-s <speech file>, --speechfile <speech file>
Decodes the speech file. The demo detects which type of speech file is supplied using the file extension.
The only supported speech algorithm as of now is G.711 (.g711 extension).
-y <1-3>, --display_standard <1-3>
Sets the resolution of the display. Clips larger than the display will be center clamped, and clips smaller than the display will be centered.
1 D1 @ 30 fps (NTSC) [Default]
2 D1 @ 25 fps (PAL)
3 720P @ 60 fps
-l, --loop
If this option is selected, the demo will restart at the beginning of a file (or files) when the end is reached. If this option is not selected (which is the default) the demo will quit once the end of the file (or files) has been reached.
-o, --osd
Enables the On Screen Display for data visualization. If this option is not passed, the data will be output to stdout instead.
-k, --keyboard
Enables the keyboard input mode which lets the user input commands using the keyboard in addition to the IR remote control interface.
At the prompt type 'help' for a list of available commands.
-t <seconds>, --time <seconds>
The number of seconds to run the demo. It defaults to infinite time.
-h, --help
This will print the usage of the demo.
You must supply at least one file for the demo to run.
The DM365mmap and CMEM kernel modules need to be inserted for this demo to run. Use the script 'loadmodules.sh' to make sure both kernel modules are loaded with adequate parameters.
Example usage
First execute this script to load the kernel modules required:
./loadmodules.sh
General usage:
./decode -h
H264 HP video on a 720p display and G.711 speech decode with OSD:
./decode -s test.g711 -v test.264 -o -y 3
MPEG4 NTSC video decode only with keyboard interface on component output:
./decode -v test.mpeg4 -k -y 1
Encode
This demo uses the codec engine to encode data from peripheral device drivers to files. Video and speech files are supported. The files created will be encoded elementary streams of video or speech. The application also playes the captured speech/video data.
Implementation details
The implementation details of encode demo application is given below
- The video part of the demo application runs in two threads (capture thread & video thread)
- The capture thread captures video frames from component/composite input in 420 semi planar format
- In case of 720P-60 input, the capture driver is programmed to run at 30fps to match expected average encoding rate
- The 720P resolution video frame captured from component input are used without any frame copy
- In case of D1 and other resolution frames the video buffer is copied (using DMA based frame copy) to video and display buffers
- The capture thread sends the video frame to video thread using a FIFO queue
- The captured frame also sent to display device for display
- The video thread gets the raw video frame from the queue, gives it to encoder to encode and writes the encoded data to a file
- The speech part of the demo application runs in one thread which reads the raw speech data from driver, encodes and writes the encoded data to a file
Usage
encode [options...]
-v <video file>, --videofile <video file>
Encodes video data to the given file. The file will be created if it doesn't exist, and truncated if it does exist. The demo detects which type of video file is supplied using the file extension. Supported video algorithms are MPEG4 SP, H.264 MP (.mpeg4 or .m4v extension, .264).
-s <speech file>, --speechfile <speech file>
Encodes speech data to the given file. The file will be created if it doesn't exist, and truncated if it does exist. The demo detects which type of speech file is supplied using the file extension. The only supported speech algorithm as of now is G.711 (.g711 extension).
-y <1-3>, --display_standard <1-3>
Sets the resolution of the display. If the captured resolution is larger than the display it will be center clamped, and if it is smaller the image will be centered.
1 D1 @ 30 fps (NTSC) [Default]
2 D1 @ 25 fps (PAL)
3 720P @ 60 fps
-r <resolution>, --resolution <resolution>
The resolution of video to encode in the format 'width'x'height'.
Default is the size of the video standard (720x480 for NTSC, 720x576 for PAL, 1280x720 for 720P).
-b <bit rate>, --videobitrate <bit rate>
This option sets the bit rate with which the video will be encoded. Use a negative value for variable bit rate. Default is variable bit rate.
-x, --svideo
Use s-video video input instead of the composite default.
-l, --linein
This option makes the input device for sound recording be the 'line in' as opposed to the 'mic in' default.
-k, --keyboard
Enables the keyboard input mode which lets the user input commands using the keyboard in addition to the IR remote control interface. At the prompt type 'help' for a list of available commands.
-t <seconds>, --time <seconds>
The number of seconds to run the demo. Defaults to infinite time.
-o, --osd
Enables the On Screen Display for data visualization. If this option is not passed, the data will be output to stdout instead.
-h, --help
This will print the usage of the demo.
You must supply at least one file for the demo to run.
The DM365mmap and CMEM kernel modules need to be inserted for this demo to run. Use the script 'loadmodules.sh' to make sure both kernel modules are loaded with adequate parameters.
Example usage
First execute this script to load the kernel modules required:
./loadmodules.sh
General usage:
./encode -h
H264 HP video encode only @720p resolution with OSD:
./encode -v test.264 -y 3 -o
H264 HP video encode from s-video and G.711 speech encode:
./encode -v test.264 -s test.g711 -x
MPEG4 SP video encode only in CIF NTSC resolution with OSD:
./encode -v test.mpeg4 -r 352x240 -o
MPEG4 SP video encode at 1Mbps with keyboard interface on D1 PAL display:
./encode -v test.mpeg4 -b 1000000 -k -y 2
Encodedecode
This demo uses the Codec Engine to encode data from the capture device using the MPEG4 SP algorithm into an intermediate buffer before the data is decoded to the display framebuffer.
Implementation details
The implementation details of encode demo application is given below
- The application runs in three threads (capture thread, video thread and display thread)
- The capture thread captures video frames from component/composite input in 420 semi planar format
- The video buffer is copied (using DMA based frame copy) to video buffer
- The capture thread sends the video frame to video thread using a FIFO queue
- The video thread gets the raw video frame from the queue, gives it to encoder to encode, then it gives the encoded frame to decoder to decode the frame and sends the decoded frame to display thread
- The display thread reads the decoded frame, copies (using DMA based frame copy) to display buffer and sends to driver for display
Usage
encodedecode [options...]
-y <1-2>, --display_standard <1-2>
Sets the resolution of the display. If the captured resolution is larger than the display it will be center clamped, and if it is smaller the image will be centered.
-v <videocodec>, --videocodec <h264 or mpeg4>
The video codec to be used for encode and decode
1 D1 @ 30 fps (NTSC) [Default]
2 D1 @ 25 fps (PAL)
-r <resolution>, --resolution <resolution>
The resolution of video to encode and decode in the format 'width'x'height'. Default is the resolution of the input video standard detected.
-b <bit rate>, --bitrate <bit rate>
This option sets the bit rate with which the video will be encoded. Use a negative value for variable bit rate. Default is variable bit rate.
-p, --passthrough
Pass the video through from capture device to display device without encoding or decoding the data.
-x, --svideo
Use s-video video input instead of the composite input default.
-k, --keyboard
Enables the keyboard input mode which lets the user input commands using the keyboard in addition to the IR remote control interface. At the prompt type 'help' for a list of available commands.
-t <seconds>, --time <seconds>
The number of seconds to run the demo. Defaults to infinite time.
-o, --osd
Enables the On Screen Display for data visualization. If this option is not passed, the data will be output to stdout instead.
-h, --help
This will print the usage of the demo.
The DM350MM and CMEM kernel modules need to be inserted for this demo to run. Use the script 'loadmodules.sh' to make sure both kernel modules are loaded with adequate parameters.
Example usage
First execute this script to load the kernel modules required:
./loadmodules.sh
General usage:
./encodedecode -h
Use NTSC CIF resolution with keyboard interface and quit after 20 sec:
./encodedecode -r 352x240 -v h264 -t 20 -k
Use a PAL display with OSD display and mpeg4 codec:
./encodedecode -y 2 -v mpeg4 -o
Comments
Comments on DM365 Demo Application

Please, add short h264 sample files created by DM365.
Thanks !
--Aospan 06:28, 10 January 2010 (CST)