当前位置: 首页 > news >正文

创业网站建设规划书太原市建设工程质量监督站网站

创业网站建设规划书,太原市建设工程质量监督站网站,网站如何制作建设,学编程怎么入门From: http://www.cnblogs.com/likwo/p/3531241.html 在使用ffmpeg解码播放TS流的时候#xff08;例如之前写过的UDP组播流#xff09;#xff0c;在连接时往往需要耗费大量时间。经过debug发现是av_find_stream_info#xff08;已抛弃#xff0c;现在使用的是avformat_fi…From: http://www.cnblogs.com/likwo/p/3531241.html 在使用ffmpeg解码播放TS流的时候例如之前写过的UDP组播流在连接时往往需要耗费大量时间。经过debug发现是av_find_stream_info已抛弃现在使用的是avformat_find_stream_info这个方法十分耗时而且是阻塞的。av_find_stream_info方法主要是获得相应的流信息其中对我的应用最有用的就是视频的分辨率。在av_find_stream_info中是要不断的读取数据包解码获得相应的信息而其中除了分辨率信息以外的东西对我的应用中是无用的。所以考虑自己手动从H.264码流中解析出视频的分辨率信息。 以下内容主要参考了这篇文章http://www.myexception.cn/internet/586390.html H.264码流的流信息都存储在了特殊的结构中叫做SPS(Sequence Parameter Set)。要解析SPS就需要知道一些H.264码流的格式信息。 在H.264码流中都是以0x00 0x00 0x01 或者 0x00 0x00 0x00 0x01为开始码的在我的应用中为后者之后通过检测开始码后第一个字节的后五位是否为700111来判断其是否为SPS。得到SPS之后就可以解析出视频的分辨率。SPS中有两个成员pic_width_in_mbs_minus1和pic_height_in_map_units_minus_1分别表示图像的宽和高但是要注意的是它们都是以16为单位在面积上就是以16*16的块为单位再减1所以实际的宽是(pic_width_in_mbs_minus1 1)*16高为(pic_height_in_map_units_minus_11)*16。 欢迎转载转载请注明出处http://guoyb.com/Tech/34.html 以下是解析宽高的代码 转载http://guoyb.com/Tech/34.html 以下部分 转自 http://blog.csdn.net/pkueecser/article/details/7367641 使用RTP传输H264的时候,需要用到sdp协议描述,其中有两项:Sequence Parameter Sets (SPS) 和Picture Parameter Set (PPS)需要用到,那么这两项从哪里获取呢?答案是从H264码流中获取.在H264码流中,都是以0x00 0x00 0x01或者0x00 0x00 0x00 0x01为开始码的,找到开始码之后,使用开始码之后的第一个字节的低5位判断是否为7(sps)或者8(pps), 及data[4] 0x1f 7 || data[4] 0x1f 8.然后对获取的nal去掉开始码之后进行base64编码,得到的信息就可以用于sdp.sps和pps需要用逗号分隔开来. 如何解析SDP中包含的H.264的SPS和PPS串 http://www.pernet.tv.sixxs.org/thread-109-1-1.html SDP中的H.264的SPS和PPS串包含了初始化H.264解码器所需要的信息参数包括编码所用的profilelevel图像的宽和高deblock滤波器等。 由于SDP中的SPS和PPS都是BASE64编码形式的不容易理解附件有一个工具软件可以对SDP中的SPS和PPS进行解析。 用法是在命令行中输入 spsparser sps.txt pps.txt output.txt 例如sps.txt中的内容为 Z0LgFNoFglE pps.txt中的内容为 aM4wpIA 最终解析的到的结果为 Start dumping SPS:   profile_idc 66   constrained_set0_flag 1   constrained_set1_flag 1   constrained_set2_flag 1   constrained_set3_flag 0   level_idc 20   seq_parameter_set_id 0   chroma_format_idc 1   bit_depth_luma_minus8 0   bit_depth_chroma_minus8 0   seq_scaling_matrix_present_flag 0   log2_max_frame_num_minus4 0   pic_order_cnt_type 2   log2_max_pic_order_cnt_lsb_minus4 0   delta_pic_order_always_zero_flag 0   offset_for_non_ref_pic 0   offset_for_top_to_bottom_field 0   num_ref_frames_in_pic_order_cnt_cycle 0   num_ref_frames 1   gaps_in_frame_num_value_allowed_flag 0   pic_width_in_mbs_minus1 21   pic_height_in_mbs_minus1 17   frame_mbs_only_flag 1   mb_adaptive_frame_field_flag 0   direct_8x8_interence_flag 0   frame_cropping_flag 0   frame_cropping_rect_left_offset 0   frame_cropping_rect_right_offset 0   frame_cropping_rect_top_offset 0   frame_cropping_rect_bottom_offset 0   vui_parameters_present_flag 0 Start dumping PPS:   pic_parameter_set_id 0   seq_parameter_set_id 0   entropy_coding_mode_flag 0   pic_order_present_flag 0   num_slice_groups_minus1 0   slice_group_map_type 0   num_ref_idx_l0_active_minus1 0   num_ref_idx_l1_active_minus1 0   weighted_pref_flag 0   weighted_bipred_idc 0   pic_init_qp_minus26 0   pic_init_qs_minus26 0   chroma_qp_index_offset 10   deblocking_filter_control_present_flag 1   constrained_intra_pred_flag 0   redundant_pic_cnt_present_flag 0   transform_8x8_mode_flag 0   pic_scaling_matrix_present_flag 0   second_chroma_qp_index_offset 10 / 这里需要特别提一下这两个参数 pic_width_in_mbs_minus1 21   pic_height_in_mbs_minus1 17 分别表示图像的宽和高以宏块16x16为单位的值减1 因此实际的宽为 (211)*16 352  spsparser.rar http://krdai.info.sixxs.org/blog/mp4-sps-pps-data.html 最近在做跟 h264 encode/decode 相關的研究目標是希望可以從 Android 的 MediaRecorder 當中取出 h264 的資訊。目前問題是在於 SPS 以及 PPS 到底要怎樣得到。由於 MediaRecorder 是寫入 mp4 檔案中所以不得已只好來去分析一下 mp4 的檔案格式發現沒有想像中的困難. 主要是參照 ISO/IEC 14496-15 這部份. 在 mp4 的檔案之中, 找到 avcC 這個字串, 之後就是接上 AVCDecoderConfigurationRecord. AVCDecoderConfigurationRecord 的 format 如下:   aligned(8) class AVCDecoderConfigurationRecord {      unsigned int(8) configurationVersion  1;      unsigned int(8) AVCProfileIndication;      unsigned int(8) profile_compatibility;      unsigned int(8) AVCLevelIndication;      bit(6) reserved  111111b;      unsigned int(2) lengthSizeMinusOne;      bit(3) reserved  111b;      unsigned int(5) numOfSequenceParameterSets;      for (i0; i numOfSequenceParameterSets; i) {         unsigned int(16) sequenceParameterSetLength ;         bit(8*sequenceParameterSetLength) sequenceParameterSetNALUnit;      }      unsigned int(8) numOfPictureParameterSets;      for (i0; i numOfPictureParameterSets; i) {         unsigned int(16) pictureParameterSetLength;         bit(8*pictureParameterSetLength) pictureParameterSetNALUnit;      }   }     對照一下這樣就可以找到 SPS 和 PPS vlc没有收到pps和sps2010-10-08 16:16问题 packetizer_h264 packetizer warning: waiting for SPS/PPS 是因为解码器只是在第一次执行编码的时候才编码出 SPS、PPS、和I_Frame  h264 packetizer has set so, that it sends sps/pps only first keyframe,Im trying to figure what breaks if that is changed so sps/pps is written in every keyframe. [出自| http://trac.videolan.org/vlc/ticket/1384] 解决办法 1、编码器编码出每个关键帧都加上SPS、PPS 据说通常情况编码器编出的 SPS、PPS是一样的所以这种方法耗费资源。 2、在服务器接收到客户端请求时发送第一个package 加上 SPS、PPS。 具体如下 1、在 VideoOpenFileSource 添加一个变量 isFirstFrame 2、构造时初始化 isFirstFrame true; 3、在int VideoOpenFileSource::readFromBufferChain() 修改如下 1 if(isFirstFrame true)2 {3 memcpy(fTo, h264_header, sizeof(h264_header)); /* h264_header pps sps*/4 offset sizeof(h264_header);5 framesize BufferChain_get(fInput.video_bufs, fTo offset);6 offset framesize;7 isFirstFrame false;8 printf(this is the first fime\n);9 sleep(1);10 }11 else12 {13 framesize BufferChain_get(fInput.video_bufs, fTo offset);14 offset framesize;15 }1 [http://topic.csdn.net/u/20100801/17/ef35e664-92ff-4144-a35f-3984dcf11da3.html| 参考] sdp 关于pps和sps的疑问 packetization-mode 主要是定义包的模式单一 NALU单元模式0非交错(non-interleaved)封包模式1交错(interleaved)封包模式2 sprop-parameter-sets 等于H.264 的序列参数集和图像参数 NAL单元base64转换即 spspps profile-level-id 这个参数用于指示 H.264 流的 profile 类型和级别。这知道这个是啥东东参考 黑暗长老 www.cppblog.com/czanyou/ ffmpeg decode 关于pps sps问题 stackoverflow.com/questions/3493742/problem-to-decode-h264-video-over-rtp-with-ffmpeg-libavcodec/3500432#3500432 如何用C语言取出H.264ES文件里的nal(sps,pps)信息。比如width, height, profile等等 请高手指点指点。。。 http://www.oschina.net/question/225813_35707 解析sps,pps的代码在ffmpeg里面就有, 抄出来就行了, 我以前也自己写过... ffmpeg的libavcodec/h264_parser.c, h264_ps.c 函数 ff_h264_decode_seq_parameter_set ff_h264_decode_picture_parameter_set 自己可以看代码. H264参数语法文档 SPS、PPS、IDR http://blog.csdn.net/heanyu/article/details/6205390 H.264码流第一个 NALU 是 SPS序列参数集Sequence Parameter Set 对应H264标准文档 7.3.2.1 序列参数集的语法进行解析
http://www.yutouwan.com/news/240655/

相关文章:

  • 网站提供服务商南京企业微信网站建设
  • 商务网站建设试卷软文推广经典案例
  • 河北建设厅网站查询wordpress仿简书
  • 网站案例展示怎么做企业展厅设计图片欣赏
  • 网站开发 学习步骤西安保安公司
  • 合肥高端网站开发公司网站 跳出率 多少
  • 大型网站建设建设公司排名手机交互网站
  • 做网站怎么招广告百度发作品入口在哪里
  • 前几年做那个网站能致富企业网络推广如何做
  • 官网模板建站塔山双喜哪里可以免费发布招聘信息
  • 凡科的网站怎么做百度推广无锡网站开发公司电话
  • 南京市网站建设石家庄新闻头条
  • 大岭山网站建设wordpress 只显示某分类
  • 饶阳营销型网站建设费用微信到wordpress
  • 做设计的都用那些网站垂直门户网站都有什么
  • 坂田建设网站网站可以做多少个关键词
  • 公司做网站那家好一般什么行业做网站的多
  • 软件公司网站wordpress动态主题
  • 大连建站万网注册域名的步骤
  • 搭建什么网站赚钱北京网站怎么建设
  • 制作卡牌的网站wordpress微拍源码
  • 怎么做自己网站的后台蜜雪冰城网页设计素材
  • 优设设计网站导航天津建设招标网站
  • 个人网站做打赏流程个人网站建立步骤
  • 做网站公司哪家好关于家乡的网页制作教程
  • 哈尔滨网站建设多少钱wordpress导航 t
  • 长沙智能建站方案高端定制网站的特点
  • 商务咨询公司网站制作模板教育网站开发文档
  • 网站安全优化yum wordpress php扩展
  • 做淘宝客网站公司法人查询