CN107343218A - Video coding method and device - Google Patents

Video coding method and device Download PDF

Info

Publication number
CN107343218A
CN107343218A CN201710372975.0A CN201710372975A CN107343218A CN 107343218 A CN107343218 A CN 107343218A CN 201710372975 A CN201710372975 A CN 201710372975A CN 107343218 A CN107343218 A CN 107343218A
Authority
CN
China
Prior art keywords
video
file
audio
encoded
vpy
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
CN201710372975.0A
Other languages
Chinese (zh)
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.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology 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 Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN201710372975.0A priority Critical patent/CN107343218A/en
Publication of CN107343218A publication Critical patent/CN107343218A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4394Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Landscapes

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

Abstract

The invention is suitable for the technical field of computers, and provides a video coding method and a video coding device, wherein the method comprises the following steps: the video encoding method comprises the steps of receiving a video source file, separating a video stream and an audio stream of the video source file, inputting the separated video stream into a preset VapourSynth control, generating a video file in a vpy format through the VapourSynth control, analyzing and encoding the video file in the vpy format to obtain an encoded video file, encoding the audio stream to obtain a corresponding audio file, carrying out format encapsulation on the encoded video file and the corresponding audio file to generate an encoded video in the preset video format, and therefore, the multi-thread video processing control VapourSynth is used as a video encoding bridge, full utilization of computer resources is effectively improved, and video encoding efficiency is effectively improved.

Description

A kind of method and device of Video coding
Technical field
The invention belongs to field of computer technology, more particularly to a kind of method and device of Video coding.
Background technology
With the development of multimedia technology, the network video such as Web TV play, network film, network variety and network direct broadcasting Frequency is increasingly favored by people, and playback volume is countless.
During Internet video is made, the data that the video file of shooting needs to be converted on computer could be in net Played on network, the data volume after directly changing is very big, therefore needs to press the video file of shooting when conversion Contracting, compression process are contemplated that the reduction of video data and distortionless problem.It can be seen that Video coding is time-consuming longer, improve The efficiency of Video coding is the key of Video coding.
The content of the invention
It is an object of the invention to provide a kind of method and device of Video coding, it is intended to solves because prior art can not A kind of effective video coding method is provided, cause Video coding it is less efficient the problem of.
On the one hand, the invention provides a kind of method of Video coding, methods described to comprise the steps:
Video source file is received, the video flowing of the video source file and audio stream are separated;
The video flowing after separation is input in default VapourSynth controls, passes through the VapourSynth Control generates the video file of vpy forms;
The video file of the vpy forms is parsed and encoded, with the video file after being encoded, while to institute State audio stream to be encoded, to obtain corresponding audio file;
Video file after the coding and corresponding audio file are entered into row format encapsulation, generate default video format Encoded video.
On the other hand, the invention provides a kind of device of Video coding, described device to include:
Audio frequency and video separation module, for receiving video source file, the video flowing of the video source file and audio are flowed into Row separation;
Video flowing input module, for the video input after analysis into default VapourSynth controls, to be led to Cross the video file of the VapourSynth controls generation vpy forms;
Audio/video coding module, for the video file of the vpy forms to be parsed and encoded, after obtaining coding Video file, while the audio stream is encoded, to obtain corresponding audio file;And
Audio frequency and video package module, for the video file of the coding and corresponding audio file to be entered into row format encapsulation, Generate the encoded video of the default video format.
The present invention is separated the video flowing of video source file and audio stream when receiving video source file, will be divided Video flowing from after is input in default VapourSynth controls, and regarding for vpy forms is generated by VapourSynth spaces Frequency file, then the video file of vpy forms is parsed and encoded, with the video file after being encoded, while to audio Stream is encoded, and to obtain corresponding audio file, the video file after coding and corresponding audio file are entered into row format envelope Dress, the encoded video of default video format is generated, so as to by using the Video processing SPACE V apourSynth conducts of multithreading The bridge of Video coding, making full use of for computer resource is effectively improved, is effectively improved the efficiency of Video coding.
Brief description of the drawings
Fig. 1 is the implementation process figure of the method for the Video coding that the embodiment of the present invention one provides;
Fig. 2 is the structural representation of the device for the Video coding that the embodiment of the present invention two provides;And
Fig. 3 is the preferred structure schematic diagram of the device for the Video coding that the embodiment of the present invention two provides.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
It is described in detail below in conjunction with specific implementation of the specific embodiment to the present invention:
Embodiment one:
Fig. 1 shows the implementation process of the method for the Video coding that the embodiment of the present invention one provides, for convenience of description, only The part related to the embodiment of the present invention is shown, details are as follows:
In step S101, video source file is received, the video flowing of video source file and audio stream are separated.
The embodiment of the present invention is applied to Video coding platform or system.Receive the video source document to be encoded of user's input Part, need to be by default separator by the video flowing and audio of video source file because the coded system of video and audio is different Flow separation comes, wherein, video source file is the video file of un-encoded processing after shooting, the audio circulation being separated It is changed to wav forms.Specifically, separator can be ffmpeg instruments.
In step s 102, the video flowing after separation is input in default VapourSynth controls, passed through VapourSynth controls generate the video file of vpy forms.
In embodiments of the present invention, VapourSynth is a video script control, or perhaps one is opened for support The frameserver (frame server) of python scripts storehouse is sent out, possesses multiple threads ability, can be used as in Video coding Bridge, undertake the role of one " go-between " in video file and Video coding application.First establish a python script Language, after opening the script, video flowing input is passed through in VapourSynth controls, wherein, it can pass through The video flowing of avisource.AVISource functions input avi forms, pass through ffms2.Source functions input mp4 forms Video flowing, then the video file for that will export set video resolution.Predetermined number video segment is intercepted in video streaming, The video segment of all interceptions is merged to obtain the video file of vpy forms, so that video flowing is further processed.Its In, vpy forms can effectively prevent video by decompiling or be cracked.
In step s 103, the video file of vpy forms is parsed and encoded, it is literary with the video after being encoded Part, while audio stream is encoded, to obtain corresponding audio file.
In embodiments of the present invention, default video encoder possibly can not Direct Recognition vpy forms video file, need First the video file of vpy forms is parsed, the video file of vpy forms is converted into the text that coding tools can identify Part.Then, the video file after parsing is encoded by video encoder, generates the audio file of coding, meanwhile, pass through Default audio coder encodes to the audio stream of video source file.Wherein, video encoder can be x264, mencoder Deng.
In step S104, the video file after coding and corresponding audio file are entered into row format encapsulation, generation is default The encoded video of video format.
In embodiments of the present invention, the video file after coding and corresponding audio file are entered into row format encapsulation, generation The encoded video of default video format.As illustratively, using ffmeg instruments by the audio of the video file of coding and coding text Part is encapsulated as the forms such as MKV, mp4.
In embodiments of the present invention, the video flowing of video source file and audio stream are separated, by the video after separation Stream is input in default VapourSynth controls, generates the video file of vpy forms, then the video file of vpy forms is entered Row parsing and coding, with the video file after encode, while are encoded to audio stream, literary with audio corresponding to obtaining Parts, the video file after coding and corresponding audio file are entered into row format encapsulation, generate the encoded video of default video format, So as to by using bridges of the Video processing SPACE V apourSynth of multithreading as Video coding, be effectively improved meter Calculation machine resource makes full use of, and is effectively improved the efficiency of Video coding.
Can be with one of ordinary skill in the art will appreciate that realizing that all or part of step in above-described embodiment method is The hardware of correlation is instructed to complete by program, described program can be stored in a computer read/write memory medium, Described storage medium, such as ROM/RAM, disk, CD.
Embodiment two:
Fig. 2 shows the structure of the device for the Video coding that the embodiment of the present invention two provides, and for convenience of description, only shows The part related to the embodiment of the present invention, including:
Audio frequency and video separation module 21, for receiving video source file, the video flowing of video source file and audio stream are carried out Separation.
In embodiments of the present invention, the video source file to be encoded of user's input is received, due to video and the volume of audio Code mode is different, need to be separated the video flowing of video source file and audio stream by default separator.
Video flowing input module 22, for the video input after analysis into default VapourSynth controls, to be passed through VapourSynth controls generate the video file of vpy forms.
In embodiments of the present invention, after opening the script, video flowing input is passed through in VapourSynth controls, Wherein, the video flowing, defeated by ffms2.Source functions of avi forms can be inputted by avisource.AVISource functions Enter the video flowing of mp4 forms, then the video file for that will export sets video resolution.Predetermined number is intercepted in video streaming Individual video segment, the video segment of all interceptions is merged to obtain the video file of vpy forms, it is further to be carried out to video flowing Processing.
Audio/video coding module 23, for the video file of vpy forms to be parsed and encoded, after being encoded Video file, while audio stream is encoded, to obtain corresponding audio file.
In embodiments of the present invention, default video encoder possibly can not Direct Recognition vpy forms video file, need First the video file of vpy forms is parsed, the video file of vpy forms is converted into the text that coding tools can identify Part.Then, the video file after parsing is encoded by video encoder, generates the audio file of coding, meanwhile, pass through Default audio coder encodes to the audio stream of video source file.
Audio frequency and video package module 24, for the video file after coding and corresponding audio file to be entered into row format encapsulation, The encoded video of the default video format of generation.
Preferably, as shown in figure 3, audio frequency and video separation module 21 includes:
Audio flow separation modular converter 311, for receiving video source file, by default separator by video source file Audio stream separate, and audio stream is converted into wav forms.
Preferably, video flowing input module 22 includes input setup module 321 and fragment interception merging module 322, wherein:
Setup module 321 is inputted, for the video flowing after separation to be input in VapourSynth controls, vpy lattice are set The video resolution of formula video file;And
Fragment intercepts merging module 322, for intercepting predetermined number video segment in video streaming, by all interceptions Video segment merges, and generates the video file of vpy forms.
Preferably, audio/video coding module 23 includes video parsing module 331, video encoding module 332 and audio coding Module 333, wherein:
Video parsing module 331, for being parsed to the video file of vpy forms, vpy forms are converted to default Video encoder identification form;
Video encoding module 332, for being encoded by video encoder to the video file after parsing, generation coding Video file afterwards;And
Audio coding module 333, for being encoded by default audio coder to audio stream, sound corresponding to generation Frequency file.
The video flowing of video source file and audio stream are separated, the video flowing after separation are input to default In VapourSynth controls, the video file of vpy forms is generated, then the video file of vpy forms is parsed and encoded, With the video file after being encoded, while audio stream is encoded, to obtain corresponding audio file, by regarding after coding Frequency file and corresponding audio file enter row format encapsulation, the encoded video of default video format are generated, so as to by using more Bridges of the Video processing SPACE V apourSynth of thread as Video coding, is effectively improved the abundant of computer resource Utilize, be effectively improved the efficiency of Video coding.
In embodiments of the present invention, each module of video coding apparatus can be realized by corresponding hardware or software module, respectively Module can be independent soft and hardware module, can also be integrated into a soft and hardware module of video coding apparatus, herein not To limit the present invention.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention All any modification, equivalent and improvement made within refreshing and principle etc., should be included in the scope of the protection.

Claims (8)

  1. A kind of 1. method of Video coding, it is characterised in that methods described comprises the steps:
    Video source file is received, the video flowing of the video source file and audio stream are separated;
    The video flowing after separation is input in default VapourSynth controls, passes through the VapourSynth controls Generate the video file of vpy forms;
    The video file of the vpy forms is parsed and encoded, with the video file after being encoded, while to the sound Frequency stream is encoded, to obtain corresponding audio file;
    Video file after the coding and corresponding audio file are entered into row format encapsulation, generate the coding of default video format Video.
  2. 2. the method as described in claim 1, it is characterised in that video source file is received, by the video of the video source file The step of stream and audio stream are separated, including:
    The video source file is received, is separated the audio stream of the video source file by default separator, and will The audio stream is converted to wav forms.
  3. 3. the method as described in claim 1, it is characterised in that be input to the video flowing after separation default In VapourSynth controls, by the VapourSynth controls generate vpy forms video file the step of, including:
    The video flowing after separation is input in the VapourSynth controls, the vpy format videos file is set Video resolution;
    Predetermined number video segment is intercepted in the video flowing, the video segment of all interceptions is merged, it is raw Into the video file of the vpy forms.
  4. 4. the method as described in claim 1, it is characterised in that the video file of the vpy forms is parsed and encoded, With the video file after being encoded, while the audio stream is encoded, with corresponding to obtaining the step of audio file, bag Include:
    The video file of the vpy forms is parsed, the vpy forms are converted to the knowledge of default video encoder Other form;
    The video file after the parsing is encoded by the video encoder, generates the text of the video after the coding Part;
    The audio stream is encoded by default audio coder, generates the corresponding audio file.
  5. 5. a kind of device of Video coding, it is characterised in that described device includes:
    Audio frequency and video separation module, for receiving video source file, the video flowing of the video source file and audio stream are divided From;
    Video flowing input module, for into default VapourSynth controls, the video input after analysis to be passed through into institute State the video file of VapourSynth controls generation vpy forms;
    Audio/video coding module, for the video file of the vpy forms to be parsed and encoded, with regarding after being encoded Frequency file, while the audio stream is encoded, to obtain corresponding audio file;And
    Audio frequency and video package module, for the video file of the coding and corresponding audio file to be entered into row format encapsulation, generation The encoded video of the default video format.
  6. 6. device as claimed in claim 5, it is characterised in that the audio frequency and video separation module includes:
    Audio flow separation modular converter, for receiving the video source file, by default separator by the video source document The audio stream of part is separated, and the audio stream is converted into wav forms.
  7. 7. device as claimed in claim 5, it is characterised in that the video flowing input module includes:
    Setup module is inputted, for the video flowing after separation to be input in the VapourSynth controls, described in setting The video resolution of vpy format video files;And
    Fragment intercepts merging module, for intercepting predetermined number video segment in the video flowing, by all interceptions Video segment merge, generate the video file of the vpy forms.
  8. 8. device as claimed in claim 5, it is characterised in that the audio/video coding module includes:
    Video parsing module, for being parsed to the video file of the vpy forms, the vpy forms are converted to pre- If video encoder identification form;
    Video encoding module, for being encoded by the video encoder to the video file after the parsing, generate institute State the video file after coding;And
    Audio coding module, for being encoded by default audio coder to the audio stream, generate described corresponding Audio file.
CN201710372975.0A 2017-05-24 2017-05-24 Video coding method and device Pending CN107343218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710372975.0A CN107343218A (en) 2017-05-24 2017-05-24 Video coding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710372975.0A CN107343218A (en) 2017-05-24 2017-05-24 Video coding method and device

Publications (1)

Publication Number Publication Date
CN107343218A true CN107343218A (en) 2017-11-10

Family

ID=60220598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710372975.0A Pending CN107343218A (en) 2017-05-24 2017-05-24 Video coding method and device

Country Status (1)

Country Link
CN (1) CN107343218A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110769281A (en) * 2019-11-08 2020-02-07 贵阳朗玛信息技术股份有限公司 Method and device for sharing audio and video

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004056122A1 (en) * 2002-12-13 2004-07-01 Gigasphere Technology Group, Inc. Method and apparatus for signal transcoding
CN102724551A (en) * 2012-06-13 2012-10-10 天脉聚源(北京)传媒科技有限公司 Video encoding system and video encoding method
CN105142037A (en) * 2015-09-10 2015-12-09 北京暴风科技股份有限公司 Distributed transcoded audio and video synthesis method and system
CN106210884A (en) * 2016-07-13 2016-12-07 腾讯科技(深圳)有限公司 The code-transferring method of video file and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004056122A1 (en) * 2002-12-13 2004-07-01 Gigasphere Technology Group, Inc. Method and apparatus for signal transcoding
CN102724551A (en) * 2012-06-13 2012-10-10 天脉聚源(北京)传媒科技有限公司 Video encoding system and video encoding method
CN105142037A (en) * 2015-09-10 2015-12-09 北京暴风科技股份有限公司 Distributed transcoded audio and video synthesis method and system
CN106210884A (en) * 2016-07-13 2016-12-07 腾讯科技(深圳)有限公司 The code-transferring method of video file and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
_: ""介绍一个将会取代AviSynth的新工具--VapourSynth"", 《百度贴吧》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110769281A (en) * 2019-11-08 2020-02-07 贵阳朗玛信息技术股份有限公司 Method and device for sharing audio and video

Similar Documents

Publication Publication Date Title
US20210326378A1 (en) Information processing apparatus and information processing method
US8989259B2 (en) Method and system for media file compression
WO2017063399A1 (en) Video playback method and device
CN109088887A (en) A kind of decoded method and device of Streaming Media
JP2022066477A (en) Audio bit stream decoding method using enhanced spectrum band replicated metadata in at least one filling element
JP6475228B2 (en) Operations that are aware of the syntax of media files in container format
CN105049920B (en) A kind of method for recording and device of multimedia file
CN106233380A (en) After the coding of many multi-object audio, bit rate reduces
CN101198045A (en) Stream media digital watermarking system
CN104185077A (en) Video editing method and device
CN103002353A (en) Method and device for packaging multimedia documents
CN102074257A (en) Software and hardware-decoding general multi-media playing equipment and playing method thereof
JP2022160519A (en) Media environment-driven content distribution platform
CN103491379A (en) Method and device for improving intelligent analysis performance
CN110460889A (en) A kind of video throws screen method, apparatus, system and storage medium
CN107343218A (en) Video coding method and device
CN106034252B (en) A kind of Streaming Media processing method and processing device
CN106463139A (en) Decoding device, decoding method, and program
CN103037211A (en) Decoding processing method, device and playing equipment of streaming media files
CN112866713B (en) Transcoding all-in-one machine system and transcoding method
CN105263021B (en) A kind of HEVC video encoding/decoding methods based on UVD
CN104023245B (en) A kind of net cast stream based on B/S frameworks compiles acceptance system and implementation method soon
CN103430558A (en) A method for optimizing a video stream
Schmidt et al. An approach for processing large and non-uniform media objects on mapreduce-based clusters
CN107613407A (en) A kind of video display control method, device, electronic equipment and storage medium

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: 20171110

RJ01 Rejection of invention patent application after publication