FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx

上传人:b****6 文档编号:21910265 上传时间:2023-02-01 格式:DOCX 页数:57 大小:101.61KB
下载 相关 举报
FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx_第1页
第1页 / 共57页
FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx_第2页
第2页 / 共57页
FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx_第3页
第3页 / 共57页
FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx_第4页
第4页 / 共57页
FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx_第5页
第5页 / 共57页
点击查看更多>>
下载资源
资源描述

FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx

《FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx》由会员分享,可在线阅读,更多相关《FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx(57页珍藏版)》请在冰豆网上搜索。

FFmpeg总结三AV系列结构体之AVCodecContextWord格式.docx

enumAVCodecIDcodec_id;

/*seeAV_CODEC_ID_xxx*/

*fourcc(LSBfirst,so"

ABCD"

->

('

D'

<

24)+('

C'

16)+('

B'

8)+'

A'

).

*Thisisusedtoworkaroundsomeencoderbugs.

*Ademuxershouldsetthistowhatisstoredinthefieldusedtoidentifythecodec.

*Iftherearemultiplesuchfieldsinacontainerthenthedemuxershouldchoosetheone

*whichmaximizestheinformationabouttheusedcodec.

*Ifthecodectagfieldinacontainerislargerthan32bitsthenthedemuxershould

*remapthelongerIDto32bitswithatableorotherstructure.Alternativelyanew

*extra_codec_tag+sizecouldbeaddedbutforthisaclearadvantagemustbedemonstrated

*first.

*-encoding:

Setbyuser,ifnotthenthedefaultbasedoncodec_idwillbeused.

*-decoding:

Setbyuser,willbeconvertedtouppercasebylibavcodecduringinit.

unsignedintcodec_tag;

#ifFF_API_STREAM_CODEC_TAG

*@deprecatedthisfieldisunused

unsignedintstream_codec_tag;

void*priv_data;

*Privatecontextusedforinternaldata.

*

*Unlikepriv_data,thisisnotcodec-specific.Itisusedingeneral

*libavcodecfunctions.

structAVCodecInternal*internal;

*Privatedataoftheuser,canbeusedtocarryappspecificstuff.

Setbyuser.

void*opaque;

*theaveragebitrate

Setbyuser;

unusedforconstantquantizerencoding.

Setbyuser,maybeoverwrittenbylibavcodec

*ifthisinfoisavailableinthestream

int64_tbit_rate;

*numberofbitsthebitstreamisallowedtodivergefromthereference.

*thereferencecanbeCBR(forCBRpass1)orVBR(forpass2)

unused

intbit_rate_tolerance;

*Globalqualityforcodecswhichcannotchangeitperframe.

*ThisshouldbeproportionaltoMPEG-1/2/4qscale.

intglobal_quality;

intcompression_level;

#defineFF_COMPRESSION_DEFAULT-1

*AV_CODEC_FLAG_*.

intflags;

*AV_CODEC_FLAG2_*

intflags2;

*somecodecsneed/canuseextradatalikeHuffmantables.

*MJPEG:

Huffmantables

*rv10:

additionalflags

*MPEG-4:

globalheaders(theycanbeinthebitstreamorhere)

*TheallocatedmemoryshouldbeAV_INPUT_BUFFER_PADDING_SIZEbyteslarger

*thanextradata_sizetoavoidproblemsifitisreadwiththebitstreamreader.

*ThebytewisecontentsofextradatamustnotdependonthearchitectureorCPUendianness.

Set/allocated/freedbylibavcodec.

Set/allocated/freedbyuser.

uint8_t*extradata;

intextradata_size;

*Thisisthefundamentalunitoftime(inseconds)interms

*ofwhichframetimestampsarerepresented.Forfixed-fpscontent,

*timebaseshouldbe1/framerateandtimestampincrementsshouldbe

*identically1.

*Thisoften,butnotalwaysistheinverseoftheframerateorfieldrate

*forvideo.1/time_baseisnottheaverageframerateiftheframerateisnot

*constant.

*Likecontainers,elementarystreamsalsocanstoretimestamps,1/time_base

*istheunitinwhichthesetimestampsarespecified.

*AsexampleofsuchcodectimebaseseeISO/IEC14496-2:

2001(E)

*vop_time_increment_resolutionandfixed_vop_rate

*(fixed_vop_rate==0impliesthatitisdifferentfromtheframerate)

MUSTbesetbyuser.

theuseofthisfieldfordecodingisdeprecated.

*Useframerateinstead.

AVRationaltime_base;

*Forsomecodecs,thetimebaseisclosertothefieldratethantheframerate.

*Mostnotably,H.264andMPEG-2specifytime_baseashalfofframeduration

*ifnotelecineisused...

*Settotime_baseticksperframe.Default1,e.g.,H.264/MPEG-2setitto2.

intticks_per_frame;

*Codecdelay.

*Encoding:

Numberofframesdelaytherewillbefromtheencoderinputto

*thedecoderoutput.(weassumethedecodermatchesthespec)

*Decoding:

Numberofframesdelayinadditiontowhatastandarddecoder

*asspecifiedinthespecwouldproduce.

*Video:

*Numberofframesthedecodedoutputwillbedelayedrelativetothe

*encodedinput.

*Audio:

*Forencoding,thisfieldisunused(seeinitial_padding).

*Fordecoding,thisisthenumberofsamplesthedecoderneedsto

*outputbeforethedecoder'

soutputisvalid.Whenseeking,youshould

*startdecodingthismanysamplespriortoyourdesiredseekpoint.

Setbylibavcodec.

intdelay;

/*videoonly*/

*picturewidth/height.

*@noteThosefieldsmaynotmatchthevaluesofthelast

*AVFrameoutputbyavcodec_decode_video2dueframe

*reordering.

Maybesetbytheuserbeforeopeningthedecoderifknowne.g.

*fromthecontainer.Somedecoderswillrequirethedimensions

*tobesetbythecaller.Duringdecoding,thedecodermay

*overwritethosevaluesasrequiredwhileparsingthedata.

intwidth,height;

*Bitstreamwidth/height,maybedifferentfromwidth/heighte.g.when

*thedecodedframeiscroppedbeforebeingoutputorlowresisenabled.

*@noteThosefieldmaynotmatchthevalueofthelast

*AVFrameoutputbyavcodec_receive_frame()dueframe

Maybesetbytheuserbeforeopeningthedecoderifknown

*e.g.fromthecontainer.Duringdecoding,thedecodermay

intcoded_width,coded_height;

#ifFF_API_ASPECT_EXTENDED

#defineFF_ASPECT_EXTENDED15

*thenumberofpicturesinagroupofpictures,or0forintra_only

intgop_size;

*Pixelformat,seeAV_PIX_FMT_xxx.

*Maybesetbythedemuxerifknownfromheaders.

*Maybeoverriddenbythedecoderifitknowsbetter.

*@noteThisfieldmaynotmatchthevalueofthelast

Setbyuserifknown,overriddenbylibavcodecwhile

*parsingthedata.

enumAVPixelFormatpix_fmt;

#ifFF_API_MOTION_EST

*Thisoptiondoesnothing

*@deprecatedusecodecprivateoptionsinstead

attribute_deprecatedintme_method;

*IfnonNULL,'

draw_horiz_band'

iscalledbythelibavcodec

*decodertodrawahorizontalband.Itimprovescacheusage.Not

*allcodecscandothat.Youmustcheckthecodeccapabilities

*beforehand.

*Whenmultithreadingisused,itmaybecalledfrommultiplethreads

*atthesametime;

threadsmightdrawdifferentpartsofthesameAVFrame,

*ormultipleAVFrames,andthereisnoguaranteethatsliceswillbedrawn

*inorder.

*ThefunctionisalsousedbyhardwareaccelerationAPIs.

*Itiscalledatleastonceduringframedecodingtopass

*thedataneededforhardwarerender.

*Inthatmodeinsteadofpixeldata,AVFramepointsto

*astructurespecifictotheaccelerationAPI.Theapplication

*readsthestructureandcanchangesomefieldstoindicateprogress

*ormarkstate.

*@paramheighttheheightoftheslice

*@paramytheypositionoftheslice

*@paramtype1->

topfield,2->

bottomfield,3->

frame

*@paramoffsetoffsetintotheAVFrame.datafromwhichthesliceshouldberead

void(*draw_horiz_band)(structAVCodecContext*s,

constAVFrame*src,intoffset[AV_NUM_DATA_POINTERS],

inty,inttype,intheight);

*callbacktonegotiatethepixelFormat

*@paramfmtisthelistofformatswhicharesupportedbythecodec,

*itisterminatedby-1as0isavalidformat,theformatsareorderedbyquality.

*Thefirstisalwaysthenativeone.

*@noteThecallbackmaybecalledagainimmediatelyifinitializationfor

*theselected(hardware-accelerated)pixelformatfailed.

*@warningBehaviorisundefinedifthecallbackreturnsavaluenot

*inthefmtlistofformats.

*@returnthechosenformat

Setbyuser,ifnotsetthenativeformatwillbechosen.

enumAVPixelFormat(*get_format)(structAVCodecContext*s,constenumAVPixelFormat*fmt);

*maximumnumberofB-framesbet

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 合同协议

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1