webrtc 下载代码perfetto.git 失败

[0:04:23] src/third_party/perfetto
41>WARNING: subprocess ‘”git” “-c” “core.deltaBaseCacheLimit=2g” “clone” “–no-checkout” “–progress” “https://android.googlesource.com/platform/external/perfetto.git” “/mydata/code/webrtc/src/third_party/_gclient_perfetto_knlrq6i8″‘ in /mydata/code/webrtc failed; will retry after a short nap…

[0:06:33] src/third_party/perfetto
41>WARNING: subprocess ‘”git” “-c” “core.deltaBaseCacheLimit=2g” “clone” “–no-checkout” “–progress” “https://android.googlesource.com/platform/external/perfetto.git” “/mydata/code/webrtc/src/third_party/_gclient_perfetto_knlrq6i8″‘ in /mydata/code/webrtc failed; will retry after a short nap…

同步代码时提示如上错误,

使用github的仓储进行替换。

git config –global url.https://github.com/google/perfetto.git.insteadOf https://android.googlesource.com/platform/external/perfetto.git

开源音视频编码器

https://en.wikipedia.org/wiki/List_of_open-source_codecs

 

Video codecs

x264 – H.264/MPEG-4 AVC implementation. x264 is not a codec (encoder/decoder); it is just an encoder (it cannot decode video).
OpenH264 – H.264 baseline profile encoding and decoding
x265 – An encoder based on the High Efficiency Video Coding (HEVC/H.265) standard.
Xvid – MPEG-4 Part 2 codec, compatible with DivX
libvpx – VP8 and VP9 implementation; formerly a proprietary codec developed by On2 Technologies, released by Google under a BSD-like license in May 2010.
SVT-AV1 – An AV1 encoder originally developed by Intel and Netflix, which is available as FLOSS now.[1] SVT-AV1 is generally considered to be the most optimized and fastest free AV1 encoder, which is why it serves as the base for the development of new, free, general-purpose and production-ready implementations in the AOMedia Software Implementation Working Group.[2] While SVT-AV1 already performs very well in constrained quality mode and is economically usable for many scenarios, as of the time being commercial implementations like Aurora1 may still beat it.[3]
xvc – An open source video codec, aiming to compete with h.265 and AV1. The reference implementation is released under the LGPL 2.1 and currently available in version 2.0 (as of 12/2020)[4]
FFmpeg codecs – Codecs in the libavcodec library from the FFmpeg project (FFV1, Snow, MPEG-1, MPEG-2, MPEG-4 part 2, MSMPEG-4, WMV2, SVQ1, MJPEG, HuffYUV and others). Decoders in the libavcodec (H.264, SVQ3, WMV3, VP3, Theora, Indeo, Dirac, Lagarith and others).
Lagarith – Video codec designed for strong lossless compression in RGB(A) colorspace (similar to ZIP/RAR/etc.)
libtheora – A reference implementation of the Theora format, based on VP3, part of the Ogg Project
Dirac as dirac-research, a wavelet based codec created by the BBC Research, and Schrödinger, an implementation developed by David Schleef.[5]
Huffyuv – Lossless codec from BenRG
Daala – Experimental Video codec which was under development by the Xiph.Org Foundation and finally merged into AV1.
Thor – Experimental royalty free video codec which was under development by Cisco Systems, and merged technologies into AV1.
Turing – A High Efficiency Video Coding (HEVC/H.265) encoder implemented by BBC Research.
libaom – Reference implementation for the royalty free AV1 video coding format by AOMedia, inheriting technologies from VP9, Daala and Thor.

Audio codecs[edit]
FLAC – Lossless codec developed by Xiph.Org Foundation.
LAME – Lossy compression (MP3 format).
TooLAME/TwoLAME – Lossy compression (MP2 format).
Musepack – Lossy compression; based on MP2 format, with many improvements.
Speex – Low bitrate compression, primarily voice; developed by Xiph.Org Foundation. Deprecated in favour of Opus according to www.speex.org.
CELT – Lossy compression for low-latency audio communication
libopus – A reference implementation of the Opus format, the IETF standards-track successor to CELT. (Opus support is mandatory for WebRTC implementations.)
libvorbis – Lossy compression, implementation of the Vorbis format; developed by Xiph.Org Foundation.
iLBC – Low bitrate compression, primarily voice
iSAC – Low bitrate compression, primarily voice; (free when using the WebRTC codebase)
TTA – Lossless compression
WavPack – Hybrid lossy/lossless
Bonk – Hybrid lossy/lossless; supported by fre:ac (formerly BonkEnc)
Apple Lossless – Lossless compression (MP4)
Fraunhofer FDK AAC – Lossy compression (AAC)
FFmpeg codecs in the libavcodec library, e.g. AC-3, AAC, ADPCM, PCM, Apple Lossless, FLAC, WMA, Vorbis, MP2, etc.
FAAD2 – open-source decoder for Advanced Audio Coding. There is also FAAC, the same project’s encoder, but it is proprietary (but still free of charge).
libgsm – Lossy compression (GSM 06.10)
opencore-amr – Lossy compression (AMR and AMR-WB)
liba52 – a free ATSC A/52 stream decoder (AC-3)
libdca – a free DTS Coherent Acoustics decoder
Codec2 – Low bitrate compression, primarily voice

ffmpeg合并音频至视频

ffmpeg -i autovideo_4k2k.ts -i 1kl-10kr.wav -c:v copy -c:a aac  -strict experimental -map 0:v:0 -map 1:a:0 autovideo_4K_1k.ts 
ffmpeg -i autovideo_1080_1k.mp4 -filter_complex "showwavespic=s=720x240:split_channels=1:colors=0x00ff00|0xff0000|0x0000ff" -frames:v 1 audio.png
ffmpeg -i autovideo_1080.ts -filter_complex "[0:a]showfreqs=s=1920x1080:mode=line:fscale=log,format=yuv420p[v]" -map "[v]" -map 0:a showfreqs_audio_03.mp4

 

x265 文件修改次数列表

  30 source/common/loopfilter.cpp
  30 source/common/vec/ipfilter.inc
  31 source/common/scalinglist.cpp
  31 source/common/vec/blockcopy-sse3.cpp
  31 source/encoder/predict.cpp
  32 source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
  32 source/encoder/TComRdCost_SSE.cpp
  32 source/encoder/reference.cpp
  33 source/common/cpu.cpp
  33 source/common/vec/intra-sse41.cpp
  34 source/Lib/TLibEncoder/SEIwrite.cpp
  34 source/common/vec/dct-sse41.cpp
  34 source/common/vec/pixel-sse3.cpp
  34 source/encoder/vec/vecprimitives.inc
  35 source/common/TShortYUV.cpp
  36 source/Lib/TLibCommon/TComMotionInfo.cpp
  36 source/common/picyuv.cpp
  36 source/common/wavefront.cpp
  36 source/encoder/vec/intrapred.inc
  37 source/common/shortyuv.cpp
  37 source/output/y4m.cpp
  38 intrinsic
  38 source/Lib/TLibCommon/TComBitStream.cpp
  38 source/output/yuv.cpp
  39 logic
  40 source/encoder/threadpool.cpp
  41 source/test/testpool.cpp
  43 source/common/vec/intra-ssse3.cpp
  45 source/Lib/TLibCommon/TComPicSym.cpp
  45 source/common/vec/sse.inc
  45 source/encoder/level.cpp
  45 source/x265enc.cpp
  46 source/common/vec/intra-sse3.cpp
  47 source/encoder/bitcost.cpp
  48 source/common/vec/dct-sse3.cpp
  52 source/common/intrapred.cpp
  54 source/common/arm/asm-primitives.cpp
  54 source/common/vec/vec-primitives.cpp
  54 source/encoder/macroblock.cpp
  55 source/common/deblock.cpp
  55 source/encoder/cturow.cpp
  58 source/Lib/TLibEncoder/TEncCavlc.cpp
  58 source/Lib/TLibEncoder/TEncEntropy.cpp
  58 source/common/predict.cpp
  62 source/encoder/vec/pixel.inc
  63 source/encoder/primitives.cpp
  65 source/common/vec/pixel.inc
  66 source/Lib/TLibCommon/TComWeightPrediction.cpp
  66 source/common/reference.cpp
  66 source/common/vec/ipfilter8.inc
  67 source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
  69 source/common/frame.cpp
  69 source/common/vec/dct.inc
  71 source/Lib/TLibCommon/TComPattern.cpp
  71 source/input/yuv.cpp
  72 source/Lib/TLibCommon/TComLoopFilter.cpp
  73 source/x265cfg.cpp
  74 source/common/vec/intrapred.inc
  75 source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
  75 source/common/threadpool.cpp
  75 source/common/vec/pixel-sse41.cpp
  85 source/common/lowres.cpp
  85 source/input/y4m.cpp
  91 source/encoder/weightPrediction.cpp
  92 source/Lib/TLibCommon/TComRom.cpp
  95 source/Lib/TLibCommon/TComRdCost.cpp
  95 source/encoder/vec/macroblock.inc
  97 source/Lib/TLibCommon/TComPic.cpp
 102 source/Lib/TLibCommon/TComYuv.cpp
 102 source/common/ipfilter.cpp
 103 source/Lib/TLibEncoder/TEncSbac.cpp
 104 source/test/intrapredharness.cpp
 110 source/common/cudata.cpp
 114 source/Lib/TLibCommon/TComPicYuv.cpp
 119 source/common/vec/pixel8.inc
 120 source/common/dct.cpp
 124 source/common/primitives.cpp
 132 source/test/mbdstharness.cpp
 135 source/encoder/dpb.cpp
 140 source/test/ipfilterharness.cpp
 144 source/test/testbench.cpp
 150 source/Lib/TLibEncoder/TEncSlice.cpp
 153 source/encoder/api.cpp
 157 source/encoder/sao.cpp
 160 source/Lib/TLibCommon/TComSlice.cpp
 179 source/Lib/TLibCommon/TComPrediction.cpp
 197 source/common/quant.cpp
 198 source/encoder/framefilter.cpp
 210 source/common/pixel.cpp
 215 source/Lib/TLibEncoder/TEncTop.cpp
 245 source/common/common.cpp
 249 source/encoder/motion.cpp
 258 source/Lib/TLibEncoder/TEncGOP.cpp
 261 source/Lib/TLibCommon/TComTrQuant.cpp
 271 source/Lib/TLibCommon/TComDataCU.cpp
 290 source/encoder/compress.cpp
 301 source/test/pixelharness.cpp
 324 source/Lib/TLibEncoder/TEncCu.cpp
 326 source/encoder/entropy.cpp
 378 source/x265.cpp
 411 source/common/param.cpp
 422 source/encoder/slicetype.cpp
 442 source/encoder/ratecontrol.cpp
 445 source/encoder/search.cpp
 595 source/encoder/analysis.cpp
 692 source/Lib/TLibEncoder/TEncSearch.cpp
 706 source/encoder/frameencoder.cpp
 983 source/encoder/encoder.cpp
1727 source/common/x86/asm-primitives.cpp

 

ffmpeg 截取关键帧开头的视频片段

使用如下命令获取关键帧时间点

ffprobe -select_streams v -show_frames -v quiet LG.4K.DEMO_Chess_HEVC_60FPS_10bit_HDR.ts -unit | grep key_frame=1 -A 3

获取到如下时间点

key_frame=1
pkt_pts=96005
pkt_pts_time=1.066722 s
pkt_dts=96005
--
key_frame=1
pkt_pts=186095
pkt_pts_time=2.067722 s
pkt_dts=186095
--
key_frame=1
pkt_pts=276185
pkt_pts_time=3.068722 s
pkt_dts=276185
--
key_frame=1
pkt_pts=366275
pkt_pts_time=4.069722 s
pkt_dts=366275
--
key_frame=1
pkt_pts=456365
pkt_pts_time=5.070722 s
pkt_dts=456365
--
key_frame=1
pkt_pts=546455
pkt_pts_time=6.071722 s
pkt_dts=546455
--
key_frame=1
pkt_pts=636545
pkt_pts_time=7.072722 s
pkt_dts=636545
--
key_frame=1
pkt_pts=656064
pkt_pts_time=7.289600 s
pkt_dts=656064

使用截取命令进行截取。

ffmpeg -ss 00:00:07.072 -i LG.4K.DEMO_Chess_HEVC_60FPS_10bit_HDR.ts -vcodec copy -acodec copy LG.4K.DEMO_Chess_HEVC_60FPS_10bit_HDR.no_blackstart.ts

 

FFmpeg 集成libvmaf 分析 PSNR VMAF值

1.github 下载源码

git clone https://github.com/Netflix/vmaf.git

2.下载build tools meson

https://mesonbuild.com/Getting-meson.html

Meson is available in the Python Package Index and can be installed with pip3 install meson which requires root and will install it system-wide.

Alternatively, you can use pip3 install --user meson which will install it for your user and does not require any special privileges. This will install the package in ~/.local/, so you will have to add ~/.local/bin to your PATH.

3.编译 libvmaf

cd vmaf/libvmaf 参考 README.md

meson build –buildtype release

ninja -vC build

sudo ninja -vC build install

4.FFmpeg 使能

./configure --enable-debug=3 --disable-doc --disable-optimizations --enable-pic --extra-cflags=-fPIC --enable-openssl --enable-libx264 --enable-libx265 --enable-gpl --enable-nonfree --enable-libfreetype --enable-libfdk-aac --enable-libaom --enable-libvpx --enable-libopus --enable-libvmaf --enable-version3

make -j8

make install

5.使用

ffmpeg -i xigua_h265.mp4 -i xigua_feijm.mp4 -filter_complex "[0:v]scale=1920x1080:flags=bicubic[main]; [1:v]scale=1920x1080:flags=bicubic,format=pix_fmts=yuv420p,fps=fps=25/1[ref]; [main][ref]libvmaf=psnr=1:phone_model=1:log_fmt=json" -f null - > out.json

其他命令参考:

ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf="psnr=1:log_fmt=json" -f null -
ffmpeg -i main.mpg -i ref.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=psnr=1:log_fmt=json" -f null -

参考文档:

ChristosBampis_Netflix

参考地址:

 

https://ffmpeg.org/ffmpeg-filters.html#libvmaf

Calculating VMAF and PSNR with FFmpeg

FLV 文件分析

使用 ffmpeg命令生成flv文件

ffmpeg -ss 0 -t 30  -f lavfi -i color=c=0x0000ff:s=1280x720:r=25  -ss 0 -t 30 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100  -map 0:v -map 1:a   -c:v libx264 -r:v 25  -c:a:0 aac 0ff0ff_30s_1280x720_aac2.flv

0ff0ff_30s_1280x720_aac2

上述文件使用flvmeta dump 信息如下:

Magic: FLV
Version: 1
Has audio: yes
Has video: yes
Offset: 9
--- Tag #1 at 0xD (13) ---
Tag type: scriptData
Body length: 293
Timestamp: 0
* Metadata event name: onMetaData
* Metadata contents: {
    'duration' => 30.08
    'width' => 1280
    'height' => 720
    'videodatarate' => 0
    'framerate' => 25
    'videocodecid' => 7
    'audiodatarate' => 125
    'audiosamplerate' => 44100
    'audiosamplesize' => 16
    'stereo' => true
    'audiocodecid' => 10
    'encoder' => 'Lavf58.43.100'
    'filesize' => 76289
}
Previous tag size: 304
--- Tag #2 at 0x141 (321) ---
Tag type: video
Body length: 52
Timestamp: 0
* Video codec: AVC
* Video frame type: seekable frame
* AVC packet type: AVC sequence header
Previous tag size: 63

上述文件转换为16进制如下:

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w
00000040: 6964 7468 0040 9400 0000 0000 0000 0668 idth.@………h
00000050: 6569 6768 7400 4086 8000 0000 0000 000d eight.@………
00000060: 7669 6465 6f64 6174 6172 6174 6500 0000 videodatarate…
00000070: 0000 0000 0000 0009 6672 616d 6572 6174 ……..framerat
00000080: 6500 4039 0000 0000 0000 000c 7669 6465 e.@9……..vide
00000090: 6f63 6f64 6563 6964 0040 1c00 0000 0000 ocodecid.@……
000000a0: 0000 0d61 7564 696f 6461 7461 7261 7465 …audiodatarate
000000b0: 0040 5f40 0000 0000 0000 0f61 7564 696f .@_@…….audio
000000c0: 7361 6d70 6c65 7261 7465 0040 e588 8000 samplerate.@….
000000d0: 0000 0000 0f61 7564 696f 7361 6d70 6c65 …..audiosample
000000e0: 7369 7a65 0040 3000 0000 0000 0000 0673 size.@0……..s
000000f0: 7465 7265 6f01 0100 0c61 7564 696f 636f tereo….audioco
00000100: 6465 6369 6400 4024 0000 0000 0000 0007 decid.@$……..
00000110: 656e 636f 6465 7202 000d 4c61 7666 3538 encoder…Lavf58
00000120: 2e34 332e 3130 3000 0866 696c 6573 697a .43.100..filesiz
00000130: 6500 40f2 a010 0000 0000 0000 0900 0001 e.@………….
00000140: 3009 0000 3400 0000 0000 0000 1700 0000 0…4………..
00000150: 0001 6408 1fff e100 1a67 6408 1fac d940 ..d……gd….@
00000160: 5005 bb01 1000 0003 0010 0000 0303 20f1 P…………. .
00000170: 8319 6001 0006 68eb e3cb 22c0 fdf8 f800 ..`…h…”…..

下面根据协议分析几个tag:

video_file_format_spec_v10_1

E.2 The FLV header
An FLV file shall begin with the FLV header:
FLV header
Field Type Comment
Signature UI8 Signature byte always ‘F’ (0x46)
Signature UI8 Signature byte always ‘L’ (0x4C)
Signature UI8 Signature byte always ‘V’ (0x56)
Version UI8 File version (for example, 0x01 for FLV version 1)
TypeFlagsReserved UB [5] Shall be 0
TypeFlagsAudio UB [1] 1 = Audio tags are present
TypeFlagsReserved UB [1] Shall be 0
TypeFlagsVideo UB [1] 1 = Video tags are present
DataOffset UI32 The length of this header in bytes
The DataOffset field usually has a value of 9 for FLV version 1. This field is present to accommodate larger headers
in future versions.

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….

464c 56 FLV 指明文件类型

01 文件版本

00000101 0x05 说明有Video 也有Audio数据。

00 0000 09 数据偏移,按照协议定义为9

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

E.3 The FLV File Body
After the FLV header, the remainder of an FLV file shall consist of alternating back-pointers and tags. They
interleave as shown in the following table:
FLV File Body
Field Type Comment
PreviousTagSize0 UI32 Always 0
Tag1 FLVTAG First tag
PreviousTagSize1 UI32 Size of previous tag, including its header, in bytes. For FLV version
1, this value is 11 plus the DataSize of the previous tag.
Tag2 FLVTAG Second tag

PreviousTagSizeN-1 UI32 Size of second-to-last tag, including its header, in bytes.

TagN FLVTAG Last tag
PreviousTagSizeN UI32 Size of last tag, including its header, in bytes

00 0000 00 UI32 保留位

参考E.4.1 FLV Tag

Reserved UB [2] Reserved for FMS, should be 0

Filter UB [1] Indicates if packets are filtered.
0 = No pre-processing required.
1 = Pre-processing (such as decryption) of the packet is
required before it can be rendered.
Shall be 0 in unencrypted files, and 1 for encrypted tags.
See Annex F. FLV Encryption for the use of filters.

TagType UB [5] Type of contents in this tag. The following types are
defined:
8 = audio
9 = video
18 = script data

0x12 第一tag 类型为 script data

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

DataSize UI24 Length of the message. Number of bytes after StreamID to
end of tag (Equal to length of the tag – 11)

000125 = 293 第一个tag的数据大小为293.

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

Timestamp UI24 Time in milliseconds at which the data in this tag applies.
This value is relative to the first tag in the FLV file, which
always has a timestamp of 0.

00 0000 00 TimeStamp 为0

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

TimestampExtended UI8 Extension of the Timestamp field to form a SI32 value. This
field represents the upper 8 bits, while the previous
Timestamp field represents the lower 24 bits of the time in
milliseconds.

00 时间戳 高8bit

StreamID UI24 Always 0.

00 0000 

Type UI8 Type of the ScriptDataValue.
The following types are defined:
0 = Number
1 = Boolean
2 = String
3 = Object
4 = MovieClip (reserved, not supported)
5 = Null
6 = Undefined
7 = Reference
8 = ECMA array
9 = Object end marker
10 = Strict array
11 = Date
12 = Long string

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

02 String 类型。

00 0a 大小

string Value 6f 6e4d 6574 6144 6174 61

00000000: 464c 5601 0500 0000 0900 0000 0012 0001 FLV………….
00000010: 2500 0000 0000 0000 0200 0a6f 6e4d 6574 %……….onMet
00000020: 6144 6174 6108 0000 000d 0008 6475 7261 aData…….dura
00000030: 7469 6f6e 0040 3e14 7ae1 47ae 1400 0577 tion.@>.z.G….w

08 

IF Type == 8
SCRIPTDATAECMAARRAY

SCRIPTDATAECMAARRAY
Field Type Comment
ECMAArrayLength UI32 Approximate number of items in ECMA array 0000 000d 13个item 。
Variables SCRIPTDATAOBJECTPROPERTY [ ] List of variable names and values
List Terminator SCRIPTDATAOBJECTEND List terminator

PropertyName SCRIPTDATASTRING Name of the object property or variable
PropertyData SCRIPTDATAVALUE Value and type of the object property or variable

0008 string size

6475 7261 7469 6f6e duration string value @PropertyName

00 (type number) 40 3e14 7ae1 47ae 14 64bit int2String 

循环分析剩余数据对,获取如下 信息:

‘duration’ => 30.08
‘width’ => 1280
‘height’ => 720
‘videodatarate’ => 0
‘framerate’ => 25
‘videocodecid’ => 7
‘audiodatarate’ => 125
‘audiosamplerate’ => 44100
‘audiosamplesize’ => 16
‘stereo’ => true
‘audiocodecid’ => 10
‘encoder’ => ‘Lavf58.43.100’
‘filesize’ => 76289

分析第二个tag

00000130: 6500 40f2 a010 0000 0000 0000 0900 0001 e.@………….
00000140: 3009 0000 3400 0000 0000 0000 1700 0000 0…4………..
00000150: 0001 6408 1fff e100 1a67 6408 1fac d940 ..d……gd….@
00000160: 5005 bb01 1000 0003 0010 0000 0303 20f1 P…………. .
00000170: 8319 6001 0006 68eb e3cb 22c0 fdf8 f800 ..`…h…”…..
00000180: 0000 003f 0800 0007 0000 0000 0000 00af …?…………
00000190: 0012 1056 e500 0000 0012 0900 0395 0000 …V…………
000001a0: 0000 0000 0017 0100 0050 0000 02af 0605 ………P……
000001b0: ffff abdc 45e9 bde6 d948 b796 2cd8 20d9 ….E….H..,. .
000001c0: 23ee ef78 3236 3420 2d20 636f 7265 2031 #..x264 – core 1
000001d0: 3537 2072 3239 3639 2064 3430 3939 6464 57 r2969 d4099dd
000001e0: 202d 2048 2e32 3634 2f4d 5045 472d 3420 – H.264/MPEG-4
000001f0: 4156 4320 636f 6465 6320 2d20 436f 7079 AVC codec – Copy
00000200: 6c65 6674 2032 3030 332d 3230 3139 202d left 2003-2019 –

09 类型 video TagType

00 00 34 大小52

timestamp  00 0000  24bit

00 timestamp 高8bit 

stream id 00 00 00 

StreamID UI24 Always 0.

VideoTagHeader IF TagType == 9

17

VIDEODATA

Frame Type UB [4] 1 = key frame (for AVC, a seekable frame)

CodecID UB [4] 7 = AVC

00 0 = AVC sequence header

00 00  00 IF AVCPacketType == 1
Composition time offset
ELSE
0

PreviousTagSize 0000 003f

 

 

 

aa