音视频编辑相关信息收集
FFmpeg
website
ffmpeg -y -loglevel level+error -vcodec h264 -r 15 -i "in.h264" -vcodec h264 -fpsmax 15 -b:v 1M "out.mp4" |
调整视频速率
调整视频速率的原理为:修改视频的 presentation timestamp (PTS),dts
调整音频速率
调整视频速率的原理为:简单的方法是调整音频采样率,但是这种方法会改变音色, 一般采用通过对原音进行重采样,差值等方法。
ffmpeg -i in.mkv -filter:a "atempo=2.0" -vn out.mkv |
h264 结构相关
H264结构中,一个视频图像编码后的数据叫做一帧,一帧由一个片(slice)或多个片组成,一个片由一个或多个宏块(MB)组成。
H264在网络传输的是NALU,NALU的结构是:NAL头+RBSP
tbn tbc tbr
There are three different time bases for time stamps in FFmpeg. The
values printed are actually reciprocals of these, i.e. 1/tbr, 1/tbn and
1/tbc.
tbn is the time base in AVStream that has come from the container, I
think. It is used for all AVStream time stamps.
tbc is the time base in AVCodecContext for the codec used for a
particular stream. It is used for all AVCodecContext and related time
stamps.
tbr is guessed from the video stream and is the value users want to see
when they look for the video frame rate, except sometimes it is twice
what one would expect because of field rate versus frame rate.