CN111866602A - 一种无损高精度的流采集方法 - Google Patents

一种无损高精度的流采集方法 Download PDF

Info

Publication number
CN111866602A
CN111866602A CN202010565015.8A CN202010565015A CN111866602A CN 111866602 A CN111866602 A CN 111866602A CN 202010565015 A CN202010565015 A CN 202010565015A CN 111866602 A CN111866602 A CN 111866602A
Authority
CN
China
Prior art keywords
video
data
audio
stream
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010565015.8A
Other languages
English (en)
Inventor
马萧萧
李秀科
赵思阳
王智胜
马韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Dongfangshengxing Electronics Co ltd
Original Assignee
Chengdu Dongfangshengxing Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Dongfangshengxing Electronics Co ltd filed Critical Chengdu Dongfangshengxing Electronics Co ltd
Priority to CN202010565015.8A priority Critical patent/CN111866602A/zh
Publication of CN111866602A publication Critical patent/CN111866602A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/233Processing of audio elementary streams
    • H04N21/2335Processing of audio elementary streams involving reformatting operations of audio signals, e.g. by converting from one coding standard to another
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明涉及一种无损高精度的流采集方法,所述流采集方法包括:打开实时消息传输协议流或超文本传输协议流;创建读数据线程;获取流信息;创建封装线程。本发明的一种无损高精度的流采集方法,通过只精确编辑一个组包,节省了编码时间,同时降低了机器的负荷,CPU占用低,并能精确到帧地无损地采集音视频数据。

Description

一种无损高精度的流采集方法
技术领域
本发明涉及数据流信息处理领域,尤其涉及一种无损高精度的流采集方法。
背景技术
在高速发展的互联网时代,电视台需要高性能的精确到帧地接收高指标的网络实时流媒体。这就要求从指定的视频画面(时间戳)开始收录、到指定的视频画面(时间戳)停止收录,同时又要满足音视频没有损失地收录下来。
现有的实现过程通常有如下两种方法:
第一种方法:在接收网络流时对所有音视频包解码,当到解码到指定开始画面(时间戳)时开始编码,当编码到指定结束画面(时间戳)时停止编码。这种方法确实能保证精确到帧的收录。但是所有的音视频包都进行了解码、编码,由于所有的视频都进行了编码,视频质量会降低,CPU占用率很高,不能满足高性能高指标收录。
第二种方法:在接收网络流时当视频包的时间戳大于等于指定的开始时间戳时直接封装到本地文件,直到视频时间戳等于指定的结束时间戳时停止收录。这种方法由于没有视频解码、编码过程,索引CPU占用极低。当开始收录时若指定的开始时间戳的视频不是I帧(关键帧)时,保存的本地文件的第一个GOP(图像)组不完整,解码器不能将第一个GOP组视频解码,只能从第二个GOP组开始解码,因此收录的文件不能满足精确到帧。该方法不能满足精确到帧地收录。
发明内容
本发明的目的在于,针对上述问题,提出一种无损高精度的流采集方法。
一种无损高精度的流采集方法,包括如下步骤:
S1:打开实时消息传输协议流或超文本传输协议流;
S2:创建读数据线程;
S3:获取流信息;
S4:创建封装线程。
进一步的,一种无损高精度的流采集方法,所述创建读数据线程包括如下子步骤:
S21:读流数据;
S22:解析数据,若流数据为视频包则将流数据添加到视频包链表中;若流数据为音频包则将流数据添加到音频包链表中。
进一步的,一种无损高精度的流采集方法,所述流信息包括视频流信息和音频流信息;视频流信息包括视频的宽、高、帧率、码率、编码格式、像素格式、画面组、profile和level;所述音频流信息包括音频的声道数、采样率、采样位数和格式。
进一步的,一种无损高精度的流采集方法,所述创建封装线程包括如下子步骤:
S41:根据音频源或视频源的信息打开编码器;
S42:准备第一个画面组视频数据;
S43:清除待输出视频数据包链表中指定时码前的所有视频包,将第一个视频画面组数据添加到待输出视频数据包链表头;
S44:清除音频包链表中指定时间戳timecode前所有音频数据包;
S45:循环执行封装数据。
进一步的,一种无损高精度的流采集方法,所述步骤S45包括如下子步骤:
S451:若视频包链表头数据时间戳小于音频包链表头数据时间戳,封装视频数据;否则封装音频数据。
本发明达到的有益效果:本发明的一种无损高精度的流采集方法,通过只精确编辑一个组包,节省了编码时间,同时降低了机器的负荷,CPU占用低,并能精确到帧地无损地采集音视频数据。
附图说明
图1是本发明的流采集方法流程图。
图2是本发明的创建封装线程流程图。
具体实施方式
为了使本发明的目的、技巧方案及优点更加清楚明白,下面将结合本发明实例中的附图,对本发明实例中的技术方案进行清楚、完整地描述。显然,所描述的实例仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
实施例
在本实施例中,如图1所述,一种无损高精度的流采集方法,包括如下步骤:
S1:打开实时消息传输协议流或超文本传输协议流;
S2:创建读数据线程;
S3:获取流信息;
S4:创建封装线程。
本实施例中,一种无损高精度的流采集方法,所述创建读数据线程包括如下子步骤:
S21:读流数据;
S22:解析数据,若流数据为视频包则将流数据添加到视频包链表中;若流数据为音频包则将流数据添加到音频包链表中。
本实施例中,一种无损高精度的流采集方法,所述流信息包括视频流信息和音频流信息;视频流信息包括视频的宽、高、帧率、码率、编码格式、像素格式、画面组、profile和level;所述音频流信息包括音频的声道数、采样率、采样位数和格式。
本实施例中,一种无损高精度的流采集方法,所述创建封装线程包括如下子步骤:
S41:根据音频源或视频源的信息打开编码器;
S42:准备第一个画面组视频数据(headVideoPacket);
S43:清除待输出视频数据包链表中指定时码前的所有视频包,将第一个视频画面组数据(headVideoPacket)数据添加到待输出视频数据包链表(videoPackList)头;
S44:清除音频包链表中指定时间戳timecode前所有音频数据包;
S45:循环执行封装数据。
本实施例中,一种无损高精度的流采集方法,所述步骤S45包括如下子步骤:
S451:若视频包链表头数据时间戳小于音频包链表头数据时间戳,封装视频数据;否则封装音频数据。

Claims (7)

1.一种无损高精度的流采集方法,其特征在于,包括如下步骤:
S1:打开实时消息传输协议流或超文本传输协议流;
S2:创建读数据线程;
S3:获取流信息;
S4:创建封装线程。
2.根据权利要求1所述的一种无损高精度的流采集方法,其特征在于,所述创建读数据线程包括如下子步骤:
S21:读流数据;
S22:解析数据,若流数据为视频包则将流数据添加到视频包链表中;若流数据为音频包则将流数据添加到音频包链表中。
3.根据权利要求1所述的一种无损高精度的流采集方法,其特征在于,所述步骤S3获取的流信息包括视频流信息和音频流信息。
4.根据权利要求3所述的一种无损高精度的流采集方法,其特征在于,所述视频流信息包括视频的宽、高、帧率、码率、编码格式、像素格式、画面组、profile和level;其中profile为H.264视频编码的压缩率,包括baseline、main 、high三种;level是视频编码性能,分辨率、帧率、码率越高,level则越高。
5.根据权利要求3所述的一种无损高精度的流采集方法,其特征在于,所述音频流信息包括音频的声道数、采样率、采样位数和格式。
6.根据权利要求1所述的一种无损高精度的流采集方法,其特征在于,所述创建封装线程包括如下子步骤:
S41:根据音频源或视频源的信息打开编码器;
S42:准备第一个画面组视频数据;
S43:清除待输出视频数据包链表中指定时码前的所有视频包,将第一个视频画面组数据添加到待输出视频数据包链表头;
S44:清除音频包链表中指定时间戳timecode前所有音频数据包;
S45:循环执行封装数据。
7.根据权利要求6所述的一种无损高精度的流采集方法,其特征在于,所述步骤S45包括如下子步骤:
S451:若视频包链表头数据时间戳小于音频包链表头数据时间戳,封装视频数据;否则封装音频数据。
CN202010565015.8A 2020-06-19 2020-06-19 一种无损高精度的流采集方法 Pending CN111866602A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010565015.8A CN111866602A (zh) 2020-06-19 2020-06-19 一种无损高精度的流采集方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010565015.8A CN111866602A (zh) 2020-06-19 2020-06-19 一种无损高精度的流采集方法

Publications (1)

Publication Number Publication Date
CN111866602A true CN111866602A (zh) 2020-10-30

Family

ID=72987643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010565015.8A Pending CN111866602A (zh) 2020-06-19 2020-06-19 一种无损高精度的流采集方法

Country Status (1)

Country Link
CN (1) CN111866602A (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060174032A1 (en) * 2005-01-28 2006-08-03 Standard Microsystems Corporation High speed ethernet MAC and PHY apparatus with a filter based ethernet packet router with priority queuing and single or multiple transport stream interfaces
CN102611690A (zh) * 2011-12-22 2012-07-25 南京邮电大学 一种基于超文本传输协议流化的容器格式转化方法
CN103002353A (zh) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 对多媒体文件进行封装的方法及装置
US20140341269A1 (en) * 2013-05-17 2014-11-20 Tencent Technology (Shenzhen) Company Limited Video encoding method and apparatus
CN110166846A (zh) * 2019-05-31 2019-08-23 成都东方盛行电子有限责任公司 一种基于4k码率代理编辑的缓存方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060174032A1 (en) * 2005-01-28 2006-08-03 Standard Microsystems Corporation High speed ethernet MAC and PHY apparatus with a filter based ethernet packet router with priority queuing and single or multiple transport stream interfaces
CN103002353A (zh) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 对多媒体文件进行封装的方法及装置
CN102611690A (zh) * 2011-12-22 2012-07-25 南京邮电大学 一种基于超文本传输协议流化的容器格式转化方法
US20140341269A1 (en) * 2013-05-17 2014-11-20 Tencent Technology (Shenzhen) Company Limited Video encoding method and apparatus
CN110166846A (zh) * 2019-05-31 2019-08-23 成都东方盛行电子有限责任公司 一种基于4k码率代理编辑的缓存方法

Similar Documents

Publication Publication Date Title
US9992555B2 (en) Signaling random access points for streaming video data
CN1151681C (zh) 具有mpeg编码解码器的数字记录和回放装置及其方法
US6337880B1 (en) Indexing for motion video that is compressed using interframe and intraframe techniques
CN1264120A (zh) 数字式记录重放装置
EP2589222B1 (en) Signaling video samples for trick mode video representations
CN112653904B (zh) 一种基于pts与dts修改的快速视频裁剪方法
US9883216B2 (en) Method and apparatus for carrying transport stream
US20100098161A1 (en) Video encoding apparatus and video encoding method
CN111954016A (zh) 一种直播视频流高效精准录制方案
CN111918121B (zh) 一种流媒体文件精准剪辑方法
CN111866602A (zh) 一种无损高精度的流采集方法
CN113824958A (zh) 视频分块方法、传输方法、服务器、适配器和存储介质
CN112954396B (zh) 视频的播放方法、装置、电子设备及计算机可读存储介质
JP2005516495A (ja) 既圧縮マルチメディアのビットレートの低減
CN113261283B (zh) 视频处理方法、装置及计算机可读存储介质
WO2023078048A1 (zh) 视频比特流封装、解码、访问方法及装置
CN113315931B (zh) 基于hls流的数据处理方法及电子设备
US20050025455A1 (en) Editing apparatus, bit rate control method, and bit rate control program
CN1571500A (zh) 控制数字视频数据的比特率的方法和装置
CN113055680B (zh) 一种分布式转码方法
CN116828259A (zh) 一种视频设备关键帧间隔的检测方法、装置、设备及存储介质
CN117135406A (zh) 一种多个视频无缝连续播放的方法
CN114143601A (zh) 裁剪视频的方法、装置、电子设备、存储介质及程序产品
CN104469399A (zh) 一种空间分辨率视频转码中宏块选择skip类型的方法
CN115002558A (zh) 一种直播过程中的音视频录制方法及相关设备

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201030

RJ01 Rejection of invention patent application after publication