Video 1 Subject Session Tahun Versi : : : : T0934 / Multimedia Programming Foundation 10 2009 1/0 Learning Outcomes In the end of this session, students must be able to: – Understand the basic principal of various video compression – Identify Java Media Framework syntax to manipulate basic video properties Bina Nusantara Outline • Digital Video • Digital Video Compression • Java Media Framework 2.1 API Bina Nusantara Digital Video • Sequence of digital image • Repeated recording doesn’t degrade quality • Ease of encryption and better tolerance to channel noise Bina Nusantara Digital Video Compression • • • • H.261 H.263 MPEG-1 MPEG-2 Bina Nusantara H.261 • Earlier digital video compression standard whose method of compression is adopted by later video compression standard • Development is initiated in 1988 • Is designed for videophone, videoconferencing, and other audiovisual services over telephone lines • Supports 176x144 and 352x288 resolution Bina Nusantara H.261 Format H.261 Picture Layer TR Ptype GOB PSC • Picture Start Code • Defines boundaries between pictures TR • Temporal Reference • Provides a timestamp for the picture PType • Picture Type • Specifies picture type and resolution GOB Bina Nusantara PSC • Group of Blocks … GOB H.261 Format GOB GOB Layer GBSC GN GQuant MB Bina Nusantara GBSC GN GQuant MB … • GOB Start Code • Each one is unique and identifies each GOB • Group Number • Identifies each GOB • GOB Quantizer • Indicates the quantizer to be used in GOB • Macroblock MB H.261 Format MB MB Layer Address Type MQuant Type MQuant MVD CBP b0 … • Indicates its position within GOB • Defines type of block (intra-, inter-, motion-compesanted, or non motion-compensated block) • MB Quantizer • Indicates the quantizer to be used, can override GQuant MVD • Motion Vector Data • Obtained by taking the difference between preceeding and current MB CBP • Coded Block Pattern • Indicates well/poorly matched blocks b Bina Nusantara Address • Block Layer • 8x8 block, contains data and EOB (End of Block) code B5 H.263 • Improved video coding standard for video conferencing and low bitrate communication ( < 64kbps) • Use similar compression methods to H.261 • Supports five resolutions – – – – – Bina Nusantara 128 x 96 176 x 44 352 x 288 704 x 576 1408 x 1152 H.263 Encoding Bina Nusantara Further H.263 Development H.263 H.263+ • Second version of H.263 • Improved efficiency and error resilience • Adopt many aspects of MPEG standards Bina Nusantara H.263++ • Improved of H.263+ MPEG-1 • A standard for storing and playing video on the CD at low bitrate (1.5 Mbps) • Supports only non-interlaced (progressive) video • Supports 352x240 (NTSC) and 352x288 (PAL) resolution • Allows other resolutions/formats as long as it is within Constrained Parameter Set (CPS) CPS Bina Nusantara Value Horizontal size of picture <=768 Vertical size of picture <=576 Number of macroblocks/picture <=396 Number of macroblocks/second <=9900 Frame rate <=30fps Bitrate <=1856kbps MPEG-1 Format MPEG-1 Sequence Layer Sequence header GOP GOP … Sequence end code Sequence • Contains picture information, such as horizontal & vertical size, pixel aspect ratio, frame rate, bit rate, etc header GOP Bina Nusantara • Group of Pictures layer • Contains one or more pictures MPEG-1 Format GOP GOP Layer GOP header Picture Picture … Picture GOP header • Contains information, such as time code to indicate hourminute-second-frame from the start of the sequence Picture • Can be divided in one or more slices (more flexible than GOB) Bina Nusantara MPEG-1 Format Picture Picture header Slice Slice … Slice header MB MB … MB B0 B1 B2 B3 B4 Picture Layer Slice Layer MB Layer Slice header MB B Bina Nusantara MB header • Specifies the length and position of each slice • Macroblocks • 8x8 block, similar to MB’s H.261 • Blocks layer Slice B5 MPEG-2 • Development started in 1990 • Initially developed as a standard for digital broadcast TV, now adopted for DVD • Supports interlaced video • For higher-quality video at more than 4 Mbps bitrate • Better error checking and correction • More flexible video format such as 1920x1152, 1440x1152, 720x576, 352x288, etc Bina Nusantara JMF 2.1 API • The Java Media Framework API (JMF) enables audio, video and other time-based media to be added to applications and applets built on Java technology. • Load video • Start and stop video Bina Nusantara Sample Code Create Player from file and add ControllerListener ControllerListener which update Visual and Controls Component Bina Nusantara Sample Code Result Bina Nusantara References • Java Media Framework. 2009. http://en.wikipedia.org/wiki/Java_Media_Framework • Image Compression. 2009. http://en.wikipedia.org/wiki/Image_compression • H.263 Video Codec. 2004. http://www.brogent.com/brogentENG/eng/tech/video_2.htm • Java Media Framework API Guide. 1999. http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/gui de/index.html • Java Media Development with QuickTime for Java. 2002. http://onjava.com/pub/a/onjava/2002/12/23/jmf.html • Playing Video and Other Media with the Java Media Framework. 2006. http://www.deitel.com/articles/java_tutorials/20060422/PlayingVideo withJMF/ Bina Nusantara