beautypg.com

Demo program, Notes on the mp4 format – Sensoray 2253 Linux User Manual

Page 8

background image

Demo Program

Make sure video source is connected and turned on.

1. Make demo with command “make demo”
2. “./capture” runs the demo application.
3. Type “./capture -h” for help menu.
4. For example, type “./capture -4 -b 2000000 -o output.m4v” to

save a MPEG4 video at 2 Mbps in the file output.m4v.

Mplayer could be used to display live video captured by the 2253. Below are
some example Mplayer commands to display various formats:

mplayer tv:// -tv outfmt=yuy2:width=320:height=240:norm=NTSC:device=/dev/video1

mplayer tv:// -tv outfmt=uyvy:width=320:height=240:norm=NTSC:device=/dev/video1

mplayer tv:// -tv outfmt=mjpg:width=320:height=240:norm=NTSC:device=/dev/video1

MPEG4: mplayer tv:// -tv outfmt=0x5634504d:width=640:height=480:norm=NTSC

H264: mplayer tv:// -tv outfmt=0x34363248:width=640:height=480:norm=NTSC

The options for changing the format use the outfmt setting. The width and

height settings control the image size. The norm setting can take NTSC or
PAL. The device setting can select which capture device to play from, allowing
you to use two mplayer commands to display both streams simultaneously.

Notes on the MP4 format

The MP4 container format produced by the 2253 features audio and video
sync muxed in a single stream. The device itself creates a “fragmented” MP4
stream, which makes it possible to stream incrementally over USB or
network. A fragmented file is always valid, in case of power loss or
interruption. Unfortunately the fragmented format has limited application
support and may only play with Quicktime, MPlayer and FFmpeg. To ensure
the recorded MP4 files are playable in most players, the capture demo
transparently transcodes the fragmented stream in memory to a normal MP4
file.
To capture in normal MP4 format, use the -m option and the -4 or -x option
with the capture demo. The output must be to a file.
To capture in fragmented MP4 format, use the -z option and the -4 or -x
option. Note that this file may not play in some players.
To play a MP4 file with the video output device, it must be in the fragmented
format. For example, “cat output.mp4f > /dev/video2” will play the file on the
device.
To play a MP4 file that is non-fragmented, use the playback demo program,
which can convert the file on-the-fly to the fragmented format and play it on
the device.

8

This manual is related to the following products: