FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Getting started with audio data processing: H.264 video code stream analysis

     

    rtcodeprefix_len is the size of the NALU excluding the start code nalu-> len = (pos + rewind) -nalu-> startcodeprefix_len; memcpy (nalu-> buf, & Buf [nalu-> startcodeprefix_len], nalu-> len); // NALU-> forbidden_bit = nalu-> buf [0] & 0x80; // 1 bit nalu-> nal_reference_idc = nalu-> buf [0] & 0x60; // 2 bit nalu-> nal_unit_type = (NALU-> BUF [0 ]) & 0x1f; // 5 bit free (buf);} / ** * Analysis H.264 BitStream * @Param Url location. * / Int simplest_h264_parser (charser * URL) {nalu_t * n; int buffersize = 100000; // file * myout = fopen ("Output_log.txt", "WB +" "); file * myout = stdout; h264bitstream = fopen (url," " RB + ""); if (h264bitstream == null) {printf ("" Open file error \ n ""); return 0;} n = (nalu_t *) Calloc (1, sizeof (nalu_t)); if (n = = NULL) {Printf ("Alloc NALU ERROR \ N" "); return 0;} n-> max_size = buffersize; n-> buf = (char *) Calloc (buffersize, sizeof (char)); if (N -> buf == null) {free (n); Printf ("" "Allocnalu: N-> BUF"); return 0;} int data_offset = 0; int DATA_OFFSET = 0; int NAL_NUM = 0; Printf ("" ----- +------ NALU TABLE ------ + ------- + \ n ""); Printf (" "NUM | POS | IDC | TYPE | LEN | \ N" "); Printf (" "----- +------- + ------ + ---- - + -------- + \ n "" "; While (! Feof (h264bitstream) {Int Data_LENTH; DATA_LENTH = GetAnnexBnalu (N); char Type_str [20] = {0}; switch (n-> nal_unit_type) {case NALU_TYPE_SLICE: sprintf (type_str, "" SLICE ""); break; case NALU_TYPE_DPA: sprintf (type_str, "" DPA ""); break; case NALU_TYPE_DPB: sprintf (type_str, "" DPB " "); Break; case nalu_type_dpc: sprintf (type_str," "DPC"); Break; case nalu_type_idr: sprintf (type_str, "" iDR "); break; case nalu_type_sei: sprintf (Type_Str," SEI ") Break; case nalu_type_sps: sprintf (type_str, "" SPS "); Break; Case Nalu_Type_pps: sprintf (Type_Str," PPS "); break; case nalu_type_aud: sprintf (Type_Str," AUD "); Break ; case NALU_TYPE_EOSEQ: sprintf (type_str, "" EOSEQ ""); break; case NALU_TYPE_EOSTREAM: sprintf (type_str, "" EOSTREAM ""); break; case NALU_TYPE_FILL: sprintf (type_str, "" FILL ""); break;} Char IDC _STR [20] = {0}; switch (n-> nal_reference_idc >> 5) {case nalu_priority_disposable: sprintf (idc_str, "" dispos "); break; case nalu_pririty_low: sprintf (idc_str," low "); Break; casser_priority_high: sprintf (idc_str, "high"); break; case nalu_priority_highest: sprintf (idc_str, "" highest "); Break;} fprintf (myout," "% 5D |% 8D |% 7s | % 6s |% 8D | \ n "", NAL_NUM, DATA_OFFSET, IDC_STR, TYPE_STR, N-> LEN); DATA_OFFSET = DATA_OFFSET + DATA_LENTH; NAL_NUM ++;} // free if (n) {i (n-> buf) { Free (n-> buf); n-> buf = null;} free (n);} return 0;} The function call method above is as follows. SimpleSt_H264_Parser ("SINTEL.H264"); result The input of this program is a file path of a H.264 original code stream (bare stream), which outputs NALU statistics of the code stream, as shown in the following figure. download SimpleSt Mediadata Test Project homepage SourceForge: https://sourceforge.net/projects/simplest-mediadata-test/ GitHub: https://github.com/leixiaohua1020/simplest_mediadata_test Open source China: http://git.oschina.net/leixiaohua1020/simplest_mediadata_test CSDN Download Download: http: //download.csdn.net/detail/leixiaohua1020/9422409 This project includes several views of audio data parsing examples: (1) pixel data handler. Contains functions of RGB and YUV pixel format processing. (2) Audio sampling data handler. Contains functions for PCM audio sampling format processing. (3) H.264 code stream analysis program. The NALU can be isolated and analyzed. (4) AAC code stream analysis program. The ADTS frame can be separated and parse. (5) FLV package format analysis program. The MP3 audio code stream in the FLV can be separated. (6) UDP-RTP protocol analysis program. UDP / RTP / MPEG-TS packets can be analyzed. Lei Xiaohua, [email protected]://blog.csdn.net/leixiaohua1020

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us