Compressed Formats

Table 2.9. Compressed Image Formats
Identifier Code Details
V4L2_PIX_FMT_MPEG 'MPEG' MPEG multiplexed stream. The actual format is determined by
extended control V4L2_CID_MPEG_STREAM_TYPE, see Table 1.2, “MPEG Control IDs”.
V4L2_PIX_FMT_H264 'H264' H264 video elementary stream with start codes.
V4L2_PIX_FMT_H264_NO_SC 'AVC1' H264 video elementary stream without start codes.
V4L2_PIX_FMT_H263 'H263' H263 video elementary stream.
V4L2_PIX_FMT_MPEG1 'MPG1' MPEG1 video elementary stream.
V4L2_PIX_FMT_MPEG2 'MPG2' MPEG2 video elementary stream.
V4L2_PIX_FMT_MPEG4 'MPG4' MPEG4 video elementary stream.
V4L2_PIX_FMT_XVID 'XVID' Xvid video elementary stream.
V4L2_PIX_FMT_VC1_ANNEX_G 'VC1G' VC1, SMPTE 421M Annex G compliant stream.
V4L2_PIX_FMT_VC1_ANNEX_L 'VC1L' VC1, SMPTE 421M Annex L compliant stream.

If the device supports read(/write) mode, I suppose you could simply read the device node as
 a file. 'vlc v4l2c:///dev/video0 --demux h264' might work "thanks" to a software bug whereby
 the format is not reset, but I have not tried. V4L2 H.264 is supported in
VLC version 2.0.2-git:

vlc v4l2:///dev/video0:chroma=h264

vlc v4l2:///dev/video0:width=320:height=240:chroma=h264

At least for UVC devices, it's pretty damn straight forward. You just need to
set pixel format 'H264' with the standard VIDIOC_S_FMT. Then you get the H.264
elementary stream with the plain normal streaming or read/write modes of V4L2.

# v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=H264
# vlc v4l2c/h264://

hw example:


v4l videocap


Compressed Formats

h264 via V4L2

立你斯 發表在 痞客邦 留言(0) 人氣()