ffmpeg怎么处理动态帧率(VFR)的视频
发表于 : 2016-12-24 23:29
像下面这种动态帧率的视频,如何转码好点?
-----------
我知道怎么弄了,谢谢……
-----------
我知道怎么弄了,谢谢……
用什么软件好点?nyfair 写了:你们真折腾,这种事尽量别用ffmpeg做
动态帧率(VFR)
1. 試試 套件 handbrake用什么软件好点?
代码: 全选
原视频的mediainfo信息
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1h 22mn
Bit rate : 1 205 Kbps
Maximum bit rate : 11.5 Mbps
Width : 960 pixels
Height : 720 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 25.629 fps
Original frame rate : 29.970 fps
Minimum frame rate : 14.985 fps
Maximum frame rate : 119.880 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.068
Title : Imported with GPAC 0.4.6-DEV-git-5ca3a9a
Writing library : x264 core 142 r2409M+r890[x64] release1
Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.20 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=4 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=21.0 / qcomp=0.75 / qpmin=0 / qpmax=69 / qpstep=12 / ip_ratio=1.50 / pb_ratio=1.30 / aq=1:0.60
Color range : Limited
Matrix coefficients : BT.709
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 1h 22mn
Bit rate mode : Variable
Bit rate : 160 Kbps
Maximum bit rate : 266 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
參閱我用的是ffmpeg来处理的
kashu 写了:poloshiao, 感谢推荐。电脑里很早就已经安装了HandBrake 0.10.5,但几乎没用过这软件。
我用的是ffmpeg来处理的(x264命令没研究过,选项参数不会敲,不知道用x264处理出来的效果和ffmpeg相比会有怎样的差异?)
ffmpeg -i a.mp4 -hide_banner -c:v libx264 -b:v 500k -vf scale=-1:480 -tune animation -r 119.88 -vsync 2 -preset veryslow -c:a aac -b:a 96k b.mp4
代码: 全选
原视频的mediainfo信息 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1h 22mn Bit rate : 1 205 Kbps Maximum bit rate : 11.5 Mbps Width : 960 pixels Height : 720 pixels Display aspect ratio : 4:3 Frame rate mode : Variable Frame rate : 25.629 fps Original frame rate : 29.970 fps Minimum frame rate : 14.985 fps Maximum frame rate : 119.880 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.068 Title : Imported with GPAC 0.4.6-DEV-git-5ca3a9a Writing library : x264 core 142 r2409M+r890[x64] release1 Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.20 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=4 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=21.0 / qcomp=0.75 / qpmin=0 / qpmax=69 / qpstep=12 / ip_ratio=1.50 / pb_ratio=1.30 / aq=1:0.60 Color range : Limited Matrix coefficients : BT.709 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 1h 22mn Bit rate mode : Variable Bit rate : 160 Kbps Maximum bit rate : 266 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy
普通使用区别不大,x264通过链接libavcodec和libavofrmat后可以直接拿ffmpeg当输入。kashu 写了:x264 core 142 r2409M+r890
120fps压到30fps为什么可能会卡?astolia 写了:最高120fps被你压到30fps怎能不卡,你原视频的比特率有多少?试试-maxrate和-bufsize参数
代码: 全选
$ ffmpeg
ffmpeg version N-82963-g9ec52a0a9b-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-4) 20161202
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 70.100 / 57. 70.100
libavformat 57. 61.100 / 57. 61.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
如果是动态的fps转换成固定的fps时,就会发现画面卡,不自然。nyfair 写了:120fps压到30fps为什么可能会卡?astolia 写了:最高120fps被你压到30fps怎能不卡,你原视频的比特率有多少?试试-maxrate和-bufsize参数