Multimedia/GStreamer

GStreamer pwg: ch. 16

Roien 2021. 12. 22.
반응형

 

16.     Media Types and Properties

 

Ÿ   가능하면 존재하는 type을 사용

Ÿ   type 생성 시 GStreamer developer IRC mailing list를 통해 discuss

Ÿ   새로운 format name conflict를 발생하는지 확인

Ÿ   명확한 name 사용

    n  ex. mp3에 대해서 audio/compressed가 아닌 audio/mp3를 사용

Ÿ   Defined Types list에 명확하게 추가

 

 

16.1.     building a simple format for testing

 

media type property에 대한 naming guideline

media type은 IANA에 의해 정의된 Mime-type과 동일해야 함

혹은 "type/x-name" 이어야 함 (type audio, video )

 

 

16.2.     Typefind functions and Autoplugging

 

Ÿ   typefinding

    n  data stream type을 찾는 과정

    n  구성

        s   typefind functions

            -       개수 제한 없음

            -       input stream에서 하나 이상의 type을 인식하는 함수

        s   typefind function들을 등록하는 함수

            -       Typefind Core

    n  Typefind core 상에서 autoplugger를 작성

        s   input streamdmfh 동적으로 type을 찾고 pipeline을 구성

 

typefind functions

보통 gst-plugins-base/gst/typefind/gsttypefindfunctions.c 여기에 위치

 

AVI file들을 인식하는 example

    Ÿ   "RIFF" tag로 시작 + file size + "AVI" tag

 

static GstStaticCaps avi_caps = GST_STATIC_CAPS ("video/x-msvideo");
#define AVI_CAPS gst_static_caps_get(&avi_caps)
 
static void
gst_avi_typefind_function (GstTypeFind *tf,
              gpointer     pointer) {
  guint8 *data = gst_type_find_peek (tf, 0, 12);
 
  if (data &&
      GUINT32_FROM_LE (&((guint32 *) data)[0]) == GST_MAKE_FOURCC ('R','I','F','F') &&
      GUINT32_FROM_LE (&((guint32 *) data)[2]) == GST_MAKE_FOURCC ('A','V','I',' ')) {
    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, AVI_CAPS);
  }
}
 
GST_TYPE_FIND_REGISTER_DEFINE(avi, "video/x-msvideo", GST_RANK_PRIMARY,
    gst_avi_typefind_function, "avi", AVI_CAPS, NULL, NULL);
 
static gboolean
plugin_init (GstPlugin *plugin) {
  return GST_TYPEFIND_REGISTER(avi, plugin);
}

 

 

16.3.     List of Defined Types

 

types

    Ÿ   audio, video, container, subtitle, etc.

    Ÿ   type의 정의는 IANA rule을 따르도록 했음

        n  http://www.iana.org/assignments/media-types

 

대부분의 property들은 container header에서 추출될 수 있음

없는 경우 stream header parsing 하여 추출

 

Ÿ   AVI haeder

    n  sample rate등을 제공

    n  MPEG system은 제공하지 않음

    n  , AVI stream demuxcer samplerate property MPEG audio system을 위해 제공해야 함

    n  이런 data를 필요로 하는 decoder stream parsr에게 두가지의 추출을 요청해야함

        s   header의 추출

        s   stream으로부터의 계산

 

audio types

Media Type Description
All audio types.  
audio/* All audio types
channels integer
channel-mask bitmask
format string
layout string
All raw audio types.  
audio/x-raw Unstructured and uncompressed raw audio data.
All encoded audio types.  
audio/x-ac3 AC-3 or A52 audio streams.
audio/x-adpcm ADPCM Audio streams.
block_align integer
audio/x-cinepak Audio as provided in a Cinepak (Quicktime) stream.
audio/x-dv Audio as provided in a Digital Video stream.
audio/x-flac Free Lossless Audio codec (FLAC).
audio/x-gsm Data encoded by the GSM codec.
audio/x-alaw A-Law Audio.
audio/x-mulaw Mu-Law Audio.
audio/x-mace MACE Audio (used in Quicktime).
audio/mpeg Audio data compressed using the MPEG audio encoding scheme.
framed boolean
layer integer
bitrate integer
audio/x-qdm2 Data encoded by the QDM version 2 codec.
audio/x-pn-realaudio Realmedia Audio data.
audio/x-speex Data encoded by the Speex audio codec
audio/x-vorbis Vorbis audio data
audio/x-wma Windows Media Audio
audio/x-paris Ensoniq PARIS audio
audio/x-svx Amiga IFF / SVX8 / SV16 audio
audio/x-nist Sphere NIST audio
audio/x-voc Sound Blaster VOC audio
audio/x-ircam Berkeley/IRCAM/CARL audio
audio/x-w64 Sonic Foundry's 64 bit RIFF/WAV

 

video types

Media Type Description
All video types.  
video/* All video types
height integer
framerate fraction
max-framerate fraction
views integer
interlace-mode string
chroma-site string
colorimetry string
pixel-aspect-ratio fraction
format string
All raw video types.  
video/x-raw Unstructured and uncompressed raw video data.
All encoded video types.  
video/x-3ivx 3ivx video.
video/x-divx DivX video.
video/x-dv Digital Video.
video/x-ffv FFMpeg video.
video/x-h263 H-263 video.
h263version string
video/x-h264 H-264 video.
video/x-huffyuv Huffyuv video.
video/x-indeo Indeo video.
video/x-intel-h263 H-263 video.
video/x-jpeg Motion-JPEG video.
video/mpeg MPEG video.
systemstream boolean
video/x-msmpeg Microsoft MPEG-4 video deviations.
video/x-msvideocodec Microsoft Video 1 (oldish codec).
video/x-pn-realvideo Realmedia video.
video/x-rle RLE animation format.
depth integer
palette_data GstBuffer
video/x-svq Sorensen Video.
video/x-tarkin Tarkin video.
video/x-theora Theora video.
video/x-vp3 VP-3 video.
video/x-wmv Windows Media Video
video/x-xvid XviD video.
All image types.  
image/gif Graphics Interchange Format.
image/jpeg Joint Picture Expert Group Image.
image/png Portable Network Graphics Image.
image/tiff Tagged Image File Format.

 

container types

Media Type Description
video/x-ms-asf Advanced Streaming Format (ASF).
video/x-msvideo AVI.
video/x-dv Digital Video.
video/x-matroska Matroska.
video/mpeg Motion Pictures Expert Group System Stream.
application/ogg Ogg.
video/quicktime Quicktime.
application/vnd.rn-realmedia RealMedia.
audio/x-wav WAV.

 

반응형

'Multimedia > GStreamer' 카테고리의 다른 글

GStreamer pwg: ch 13 part 2  (0) 2021.12.22
GStreamer pwg: ch. 14  (0) 2021.12.22
GStreamer pwg: ch. 15  (0) 2021.12.22
GStreamer pwg: ch. 17  (0) 2021.12.22
GStreamer pwg: ch. 18 clock  (0) 2021.12.22

댓글