Telecommunications: Motion Video

13
CSN 08704 D ata,A udio,Video and Im ages http://asecuritysite.com/comm s Telecomm unications P rofBill Buchanan M otion V ideo

Transcript of Telecommunications: Motion Video

CSN08704

Data, Audio, Video and Imageshttp://asecuritysite.com/comms

Telecommunications

Prof Bill Buchanan

Motion Video

Video (basically moving pictures)

Frame rate: Number of images per second

Lots of redundancy. Very little changes between frames.

Eye does not perceive certain things ... such as fast changes with the image.

MPEG ProcessRGB to

YUVDCT Quantisation

Variable Length CodingImage MPEGImage

Pixel blocks (8x8 for U and V, and 16x16 for Y)

Motion Detection

Previous pixel block

Full Partial Partial Full

Segment into Slices and into Macroblocks

Slices used todetect movement(Only luminance used for motion detection)

Macroblocks (16x16)

352x288 pixel frame (101,376

pixels)

22 macroblocks

18 macroblocks

Motion Detection• Megablocks for (0,0), (0,1) and (0,2) in the

current block are the same as in the previous blocks. Thus they can be coded simply with a reference to the previous image.

• The (0,3) megablock is different to the previous image, but the (0,3) block is identical to the (0,2) block of the previous image, thus a reference to this block is made.

• This can continue, as most of the blocks in the image are identical to the previous image.

• The only other differences in the current image are at (4,0) and (4,1); these blocks can be stored in their entirety or specified with their differences to a previous similar block

Previous image

Current image

(0,0) (0,15)

(4,0) (4,15)

I-Frame, P-Frame and B-frame• Intra frame (I-frame). A complete image and does not require any extra information to

be added to it to make it complete. No motion estimation processing. Used as a starting point for other referenced frames, and is usually the first frame to be sent.

• Predictive frame (P-frame). Uses the preceding I-frame as its reference and has motion estimation processing. Each macroblock in this frame is supplied as referenced to an I-frame as either a vector and difference.

• Bidirectional frame (B-frame). The bidirectional frame, or B-frame, is similar to the P-frame except that it references frames to the nearest preceding or future I- or P-frame.

I-Frame B-Frame B-Frame I-Frame

MPEG-2 Simple ( SP) Main (MP) SNR Spatial High HIGH (HL) Illegal 19201152,

60 fps Illegal Illegal 19201152,

60 fps 960576, 30 fps

HIGH-1440 (H-14)

Illegal 19201152, 60 fps

Illegal 14401152, 60 fps 720576, 30 fps

14401152, 60 fps 720576, 30 fps

Main (ML) 720576, 30 fps

720576, 30 fps

720576, 30 fps

Illegal 720576, 30 fps 352288, 30 fps

Low (LL) Illegal 352288, 30 fps

352288, 30 fps

Illegal Illegal

Frame rate 25 frames/sec Encoded bitstream 150 KB/sec Maximum P frame motion vectors 32, 32 Maximum B frame motion vectors 16, 16 Number of P frames 3 Number of B frames 2 (between P frames) Audio stream bitstream 64 Kbps (mono)/128 Kbps (stereo) MPEG-2 profile Main profile (see Table 11.1) MPEG-2 level Main level (see Table 11.1) Format YUV 4:2:2

MPEG-4/H264• H.264 or MPEG-4 Part 10, Advanced Video

Coding (MPEG-4 AVC) defines standard for video production.

• Has block-oriented motion-compression.• Developed by ITU-T Video Coding Experts

Group (VCEG) and ISO/IEC JTC1 Moving Picture Experts Group (MPEG).

• H.264 used with Blu-ray Disc players and now used by streaming video for Vimeo, YouTube, and HDTV broadcasts.

• Lossy compression but eye does not see the losses.

• Covered by patents and licenced by MPEG LA. Commercial use pays royalties for H.264 MPEG LA.

• Free to end users for streaming.

Previous image

Current image

(0,0) (0,15)

(4,0) (4,15)

Sample MP4 file> ffmpeg -i 1mb.mp4Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 1970-01-01 00:00:00 encoder : Lavf53.24.2 Duration: 00:00:05.31, start: 0.000000, bitrate: 1589 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1205 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: creation_time : 1970-01-01 00:00:00 handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default) Metadata: creation_time : 1970-01-01 00:00:00 handler_name : SoundHandlerAt least one output file must be specified

Link

MP4 Extract (Frames per second)

ffmpeg -i file.mp4 -r 1/4 filename%03d.jpg

Link

CSN08704

Data, Audio, Video and Imageshttp://asecuritysite.com/comms

Telecommunications

Prof Bill Buchanan

MP4 Magic Number

MP4 Magic Number (and other formats)

[00000000] 00 00 00 18 66 74 79 70 6D 70 34 32 00 00 00 01 ....ftypmp42....[00000016] 6D 70 34 32 6D 70 34 31 00 00 0B E6 6D 6F 6F 76 mp42mp41....moov[00000032] 00 00 00 6C 6D 76 68 64 00 00 00 00 BF 88 14 86 ...lmvhd........[00000048] BF 88 14 86 00 00 02 58 00 00 0B A4 00 01 00 00 .......X........

00 00 00 18 66 74 79 70 6D 70 34 32Link

AVI video file .avi 52 49 46 46 [RIFF]Flash Shockwave .swf 46 57 53 [FWS]Flash Video .flv 46 4C 56 [FLV]Mpeg 4 video file .mp4 00 00 00 ..34 32 [....ftypmp42]MOV video file .mov 6D 6F 6F 76 [....moov]Windows Video file .wmv 30 26 B2 75 8E 66 CF

Link

CSN08704

Data, Audio, Video and Imageshttp://asecuritysite.com/comms

Telecommunications

Prof Bill Buchanan

Motion Video