2020年7月5日日曜日

FFmpeg スタビライザー

FFmpeg スタビライザー -vf オプション

基本の例 ffmpegヘルプから
ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
ffmpeg -i input -vf vidstabdetect=show=1  dummy.avi

[ve1f8] Fieldsize: 112, Maximal translation: 154 pixel
[ve1f8] Number of used measurement fields: 65 out of 65
[ve1f8] Fieldsize: 32, Maximal translation: 32 pixel
[ve1f8] Number of used measurement fields: 392 out of 392
[P002524782ad40] Video stabilization settings (pass 1/2):
[P002524782ad40]      shakiness = 5
[P002524782ad40]       accuracy = 15
[P002524782ad40]       stepsize = 6
[P002524782ad40]    mincontrast = 0.250000
[P002524782ad40]         tripod = 0
[P002524782ad40]           show = 0
[P002524782ad40]         result = transforms.trf


他の例
ffmpeg -i i.mp4 -c:v hevc_qsv -vf vidstabdetect=shakiness=5:show=1  o.mp4
ffmpeg -i i.mp4 -c:v hevc_qsv -b:v 15984K -vf vidstabdetect  o.mp4

end

2020年7月3日金曜日

FFmpeg NVIDIA NVENC -b_ref_mode

NVIDIA NVENC -b_ref_mode 確認

ffmpeg -i input.mp4 -c:v hevc_nvenc -b_ref_mode 2 out.mp4


https://developer.nvidia.com/video-encode-decode-gpu-support-matrix


GTX1650 TU117 HEVC B Frame support なし
-b_ref_mode 1  エラー あり
Each B frame as referencd is not supported


-b_ref_mode 2  エラー あり
Each B frame as referencd is not supported


GTX1660 TU116 HEVC B Frame support あり
-b_ref_mode 1  エラー
Each B frame as referencd is not supported
-b_ref_mode 2  エラーなし


GTX1660TI TU116 HEVC B Frame support あり
-b_ref_mode 1  エラーあり
Each B frame as referencd is not supported

-b_ref_mode 2  エラーなし



参考
ffmpeg -encoders | find "NVIDIA"

hevc_nvenc AVOptions: 確認
ffmpeg -h encoder=hevc_nvenc



end

2020年6月29日月曜日

FFmpeg NVIDIA NVENC 詳細オプション確認コマンド

NVIDIA NVENC 詳細オプション確認コマンド

ffmpeg -h encoder=nvenc_hevc
nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)

表示した結果の一部
Encoder nvenc_hevc [NVIDIA NVENC hevc encoder]:
    General capabilities: delay hardware
    Threading capabilities: none
    Supported hardware devices: cuda cuda d3d11va d3d11va
    Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 rgb0 cuda d3d11
nvenc_hevc AVOptions:
  -preset            <int>     
  -profile           <int>     
  -level             <int>     
  -tier              <int>     
  -rc                <int>     
  -rc-lookahead      <int>     
  -surfaces          <int>     
  -cbr               <boolean> 
  -2pass             <boolean> 
  -gpu               <int>     
  -delay             <int>     
  -no-scenecut       <boolean> 
  -forced-idr        <boolean> 
  -spatial_aq        <boolean> 
  -spatial-aq        <boolean> 
  -temporal_aq       <boolean> 
  -temporal-aq       <boolean> 
  -zerolatency       <boolean> 
  -nonref_p          <boolean> 
  -strict_gop        <boolean> 
  -aq-strength       <int>
  -cq                <float>
  -aud               <boolean> 
  -bluray-compat     <boolean> 
  -init_qpP          <int>     
  -init_qpB          <int>     
  -init_qpI          <int>     
  -qp                <int>     
  -weighted_pred     <int>     
  -b_ref_mode        <int>     
  -dpb_size          <int>     



  -b_ref_mode        <int>        E..V...... Use B frames as references (from 0 to 2) (default disabled)
     disabled        0            E..V...... B frames will not be used for reference
     each            1            E..V...... Each B frame will be used for reference
     middle          2            E..V...... Only (number of B frames)/2 will be used for reference



end

FFmpeg NVIDIA H.264 hevc エンコード確認コマンド

ffmpeg.exe -encoders | find "NVIDIA"
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)


ffmpeg.exe -hide_banner -encoders | find "NVIDIA"
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)


Advanced global options:
-hide_banner hide_banner  do not show program banner
ffmpeg バージョンなどを表示させない。


This encoder is deprecated, use 'hevc_nvenc' instead

end