PIXNET Logo登入

Welkin小窩

跳到主文

柴米油鹽的平淡生活

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 10 週三 201319:06
  • MPEG-2 Transport Stream packet analyser

Example video decoding from MPEG-2 Transport Stream packet analyser
Adaptation fields
Adaptation_field_length: 7
discontinuity_indicator: False
random_access_indicator: True
ES_priority_indicator: False
PCR_flag: True
OPCR_flag: False
splicing_point_flag: False
transport_private_data_flag: False
adaptation_field_extension_flag: False
PCR: 1335803661212

PES header
stream_id: E0 (video stream 224)
PES_packet_length: 0 (undefined)
PES_scrambling: 0
PES_priority: True
data_alignment: False
copyright: False
original_or_copy: False
PTS_flag: True
DTS_flag: True
ESCR_flag: False
ES_rate_flag: False
DSM_trick_mode_flag: False
additional_copy_info_flag: False
PES_CRC_flag: False
PES_extension_flag: False
PES_header_data_length: 11
PTS: 4452723280
DTS: 4452712480

Video sequence
Sequence header code (00 00 01 B3) found at 32
horizontal_size: 720
vertical_size: 576
aspect_ratio: 16:9
frame_rate: 25
User data start code (00 00 01 B2) found at 143
AFD start code (44 54 47 31) found at 147
AFD_identifier: DTG1
active_format: 14
description: 16:9 (with shoot & protect 14:9 centre)
Group start code (00 00 01 B8) found at 118
Picture start code (00 00 01 00) found at 126
temporal_reference: 2
picture_coding_type: 1 Intra (I)
vbv_delay: 65535
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(304)

  • 個人分類:Video
▲top
  • 7月 10 週三 201315:26
  • ffmpeg中MPEG2 TS 流解碼的流程分析


ffmpeg中MPEG2 TS 流解碼的流程分析

 
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(1,526)

  • 個人分類:Video
▲top
  • 1月 17 週二 201216:07
  • What is IVF

What is IVF?

IVF stands for Indeo Video Format, most commanly known as Intel Indeo (Intel developed this video codec).
This codec was quite popular in 1990s as it was the first one to allow full-speed video playback without using hardware acceleration.
Later Intel Indeo video codec was beaten by MPEG standarts and lost it's popularity.
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(71)

  • 個人分類:Video
▲top
  • 11月 30 週三 201115:06
  • YUV pixel formats (補)

REF:http://www.sunrayimage.com/faq.html

What's sampling format?

This is the format to define how the three components (Y,U, V or R, G, B) are sampled,  including :


  • YUV 4:4:4: Y, U and V are all in sampling format, no being down-sampled


  • YUV 4:2:2: Y is in full sampling format, while U and V are down-sampled horizontally


  • YUV 4:2:0: Y is in full sampling format, while U and V are down-sampled both vertically and horizontally


  • RGB 4:4:4: R, G and B are all in sampling format, no being down-sampled




What's interlace/progressive format?

This is to define whether the video frame (the whole image) is a single progressive frame, or two interlaced fields


  • One single progressive frame:


  • Two interlaced fields:





What's pixel packing format?

This setting is used to specify the organization of YUV components for each pixel, whether in planar format or packed format:


  • planar format: Y values for all pixels are put together, as well as U and V, like: YYYYYY......UUUUUUU.......VVVVVV......




  • packed format: pixel YUV value are packed together as: YUV, YUV, YUV,....



(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(1) 人氣(147)

  • 個人分類:Video
▲top
  • 11月 30 週三 201114:52
  • YUV pixel formats

REF:http://en.wikipedia.org/wiki/Chroma_subsamplingREF:http://www.sunrayimage.com/faq.htmlWhat's sampling format?

This is the format to define how the three components (Y,U, V or R, G, B) are sampled,  including :

  • YUV 4:4:4: Y, U and V are all in sampling format, no being down-sampled

  • YUV 4:2:2: Y is in full sampling format, while U and V are down-sampled horizontally

  • YUV 4:2:0: Y is in full sampling format, while U and V are down-sampled both vertically and horizontally

  • RGB 4:4:4: R, G and B are all in sampling format, no being down-sampled

What's interlace/progressive format?

This is to define whether the video frame (the whole image) is a single progressive frame, or two interlaced fields

  • One single progressive frame:

  • Two interlaced fields:

What's pixel packing format?

This setting is used to specify the organization of YUV components for each pixel, whether in planar format or packed format:

  • planar format: Y values for all pixels are put together, as well as U and V, like: YYYYYY......UUUUUUU.......VVVVVV......

  • packed format: pixel YUV value are packed together as: YUV, YUV, YUV,....

(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(214)

  • 個人分類:Video
▲top
  • 11月 30 週三 201114:43
  • Alpha blending

Alpha4.jpg
What is "Alpha" ? "Alpha" 指的是「不透明度」= "Opacity"。
Alpha 值越大,則越不透明。本文將以 a 代替 Alpha。
What is "Alpha Blending" ? Alpha Blending 是指當有兩個 Pixel 在同一個位置時,且上方的 Pixel 為「透明的」(也就是其 alpha < 1),如此一來,後方的 Pixel 就應該會“透出“來。 事實上 Alpha Blending 也就是我們常說的 Compositing。


(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(5,265)

  • 個人分類:Video
▲top
  • 10月 17 週一 201118:57
  • MPEG PES

Packetized Elementary Stream (PES):
原始檔案的資料長度跟ES是相同的,
而ES可以切割成多個長度不一的封包 (packet),
這些封包就是PES
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(1,578)

  • 個人分類:Video
▲top
  • 2月 08 週二 201117:50
  • What is Packed Bitstream?

display-frame-seq.PNG


What is Packed Bitstream?


Many Xvid encoded movies are encoded using Packed Bitstream. What is it? First of all, for me it's important since I have a stand-alone DVD player that can play Xvid encoded avi files, but only if they don't use packed bitstream. Whenever I obtain a movie, and before I burn it on a CD-RW, I have to check if it uses packed bitstream, and if it does, use a utility to convert it to a non-packed bitstream movie (more on that later).

Let me just say up front what packed bitstream is not - it's not saving any space. Actually, when "unpacking" a packed bitstream video the result is a bit smaller (but just a few KBs smaller).

Frame (or VOP) Types
Before we can talk about packed bitstream, we'll need to talk about frame types. In MPEG4 talk, each encoded image of the movie is called a VOP (Video Object Plane). A VOP is usually equivalent to a frame: here's the explanation from Wikipedia: "In MPEG-4, VOP refers to a "Video Object Plane" which is effectively a Video frame." (We'll later see that packed bitstream is exactly where a VOP is not a frame). Here are the VOP types (I'll intermix frames and VOPs, since at this point we can consider them the same):

(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(303)

  • 個人分類:Video
▲top
  • 10月 11 週一 201016:28
  • YUV Format


YUV,是一種顏色編碼方法。

YUV是編譯true-color顏色空間(color space)的種類,Y'UV, YUV, YCbCr,YPbPr等專有名詞都可以稱為YUV,彼此有重疊。
「Y」表示明亮度(Luminance、Luma)。
「U」和「V」則是色度、濃度(Chrominance、Chroma)。
Y'UV, YUV, YCbCr, YPbPr 常常有些混用的情況,其中 YUV 和 Y'UV 通常用來描述類比訊號。
而相反的 YCbCr 與 YPbPr 則是用來描述數位的影像訊號,
例如在一些壓縮格式內 MPEG、JPEG 中,但在現今,YUV 通常已經在電腦系統上廣泛使用。

YUV Formats分成兩個格式:
緊縮格式(packed formats):將Y、U、V值儲存成Macro Pixels陣列,和RGB的存放方式類似。
平面格式(planar formats):將Y、U、V的三個份量分別存放在不同的矩陣中。

緊縮格式(packed format)中的YUV是混合在一起的,對於YUV4:4:4格式而言,用緊縮格式很合適的,因此就有了UYVY、YUYV等。

平面格式(planar formats)是指每Y份量,U份量和V份量都是以獨立的平面組織的,
也就是說所有的U份量必須在Y份量後面,而V份量在所有的U份量後面,此一格式適用於採樣(subsample)。
平面格式(planar format)有I420(4:2:0)、YV12、IYUV等。

Y'UV 的發明是由於彩色電視與黑白電視的過渡時期。
黑白視訊只有 Y(Luma,Luminance)視訊,也就是灰階值。
到了彩色電視規格的制定,是以 YUV/YIQ 的格式來處理彩色電視圖像,把 UV 視作表示彩度的 C(Chrominance或Chroma),
如果忽略 C 訊號,那麼剩下的 Y(Luma)訊號就跟之前的黑白電視訊號相同,這樣一來便解決彩色電視機與黑白電視機的相容問題。
Y'UV 最大的優點在於只需佔用極少的頻寬。

彩色圖像記錄的格式,常見的有 RGB、YUV、CMYK等。
彩色電視最早的構想是使用RGB三原色來同時傳輸。
這種設計方式是原來黑白頻寬的3倍,在當時並不是很好的設計。
RGB 訴求於人眼對色彩的感應,YUV則著重於視覺對於亮度的敏感程度,
Y 代表的是亮度,UV 代表的是彩度(因此黑白電影可省略UV,相近於RGB),
分別用Cr和CB來表示,因此YUV的記錄通常以 Y:UV 的格式呈現。

常用的YUV格式
為節省頻寬起見,大多數 YUV 格式平均使用的每像素位數都少於24位元。
主要的採樣(subsample)格式有YCbCr 4:2:0、YCbCr 4:2:2、YCbCr 4:1:1和 YCbCr 4:4:4。

YUV的表示法稱為 A:B:C 表示法:
4:4:4 表示完全取樣。
4:2:2 表示 2:1 的水平取樣,沒有垂直下採樣。
4:2:0 表示 2:1 的水平取樣,2:1 的垂直下採樣。
4:1:1 表示 4:1 的水平取樣,沒有垂直下採樣。
最常用Y:UV記錄的比重通常 1:1 或 2:1,DVD-Video 是以 YUV 4:2:0 的方式記錄,也就是我們俗稱的I420,YUV4:2:0並不是說只有U(即 Cb), V(即 Cr)一定為 0,而是指U:V互相援引,時見時隱,也就是說對於每一個行,只有一個U或者V份量,如果一行是4:2:0的話,下一行就是4:0:2,再下一行是4:2:0...以此類推。
至於其他常見的YUV格式有YUY2、YUYV、YVYU、UYVY、AYUV、Y41P、Y411、Y211、IF09、IYUV、YV12、YVU9、YUV411、YUV420等。

YUY2
YUY2(和YUYV)格式為像素保留 Y,而 UV 在水平空間上相隔二個像素採樣一次。
YVYU, UYVY格式跟YUY2類似,只是排列順序有所不同。
Y211格式是Y每2個像素採樣一次,而UV每4個像素採樣一次。
AYUV格式則有一 Alpha通道。

YV12
YV12格式與IYUV類似,每個像素都提取Y,在UV提取時,將圖像2 x 2的矩陣,每個元素中提取一個U和一個V。
YV12格式和I420格式的不同處在V平面和U平面的位置不同。
在I420格式中,U平面緊跟在Y平面之後,然後才是V平面(即:YUV);
但YV12則是相反(即:YVU)。

NV12與YV12類似,效果一樣,YV12中 U 和 V 是連續排列的,而在NV12中,U 和 V 是交錯排列的。


轉換公式眾多分歧
(隨便節錄一個)
YUV與RGB相互轉換的公式如下(RGB取值範圍均為0-255)

R = Y + (1.4075 * (V - 128));
G = Y - (0.3455 * (U - 128) - (0.7169 * (V - 128));
B = Y + (1.7790 * (U - 128);

Y = R * 0.299 + G * .587 + B *0.114;
U = R * -0.169 + G * -0.332 + B * 0.500 + 128;
V = R * 0.500 + G * -0.419 + B * -0.0813 + 128;

REF://http://zh.wikipedia.org/zh-tw/YUV
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(4,668)

  • 個人分類:Video
▲top
  • 7月 15 週四 201010:12
  • Transport Stream Transmission

4.JPG

Transport stream (TS) is a standard format for transmission and storage of audio, video, and data, and is used in broadcast systems such as DVB and ATSC.
Transport Stream is specified in MPEG-2 Part 1, Systems (formally known as ISO/IEC standard 13818-1 or ITU-T Rec. H.222.0).
Transport stream specifies a container format encapsulating packetized elementary streams, with error correction and stream synchronization features for maintaining transmission integrity when the signal is degraded.
The connection of Transport Stream to Program Stream is as follows. Firstly, PS is designed for reasonably reliable media, such as disks (like DVDs), while TS is designed for less reliable transmission, namely broadcast. Further, Transport Stream transmissions may carry multiple Program Streams.
Layers of communication
Similar to the OSI network protocol stack, a transport stream is processed by the receiver in layers.
An example stream containing video may be processed as follows:
Composition of the various programs
Packetized Elementary Stream (PES)
Elementary stream (ES) — audio or video (the below is for video only)
Group of pictures (GOP) — providing random access points
Slice — preventing an error from being propagated through intra prediction
Macroblock—consisting of 6 to 12 DCT blocks
Encoding block or just block—a DCT encoding block, 8x8 pixels
Important elements of a transport stream
Packet
A packet is the basic unit of data in a transport stream.
It consists of a sync byte, whose value is 0x47, followed by three one-bit flags and a 13-bit Packet Identifier (PID).
This is followed by a 4-bit continuity counter.
Additional optional transport fields, as signaled in the optional adaptation field, may follow.
The rest of the packet consists of payload.
Packets are 188 bytes in length, but the communication medium may add some error correction bytes to the packet.
ISDB-T and DVB-T/C/S uses 204 bytes and ATSC 8-VSB, 208 bytes as the size of emission packets (transport stream packet + FEC data).
ATSC transmission adds 20 bytes of Reed-Solomon forward error correction to create a packet that is 208 bytes long.
The 188-byte packet size was originally chosen for compatibility with ATM systems.
(繼續閱讀...)
文章標籤

BB 發表在 痞客邦 留言(0) 人氣(3,912)

  • 個人分類:Video
▲top
12»

文章分類

toggle 生活集錦 (3)
  • 影音歌詞 (17)
  • 生活其它 (4)
  • 媽媽寶寶 (25)
toggle SYSTEM (8)
  • Linux-Pre (9)
  • Yocto (1)
  • Linux System (20)
  • Embedded (19)
  • Linux Kernel (24)
  • Ubuntu Manage (8)
  • Linux Debug & Trace (2)
  • Android (21)
toggle Programing (3)
  • Trace&Debug (11)
  • GNU C (12)
  • Programing C & C++ (22)
toggle MultiMedia (3)
  • Video (20)
  • FFmpeg (14)
  • mplayer (13)
toggle Computer (3)
  • 系統安裝 (5)
  • 常見問題 (10)
  • 電腦基礎 (3)
  • 未分類文章 (1)

文章搜尋

個人資訊

BB
暱稱:
BB
分類:
不設分類
好友:
累積中
地區:

參觀人氣

  • 本日人氣:
  • 累積人氣:

Scotch甜蜜貼紙