SynoCommunity 包 FFmpeg 特定常见问题解答
FFmpeg提供了一组命令行工具来处理音频和视频媒体文件。
命令位于 /usr/local/ffmpeg
通过 /usr/local/bin 提供符号链接,如下所示,其中最新安装的版本将成为默认的 ffmpeg:
- ffmpeg4
- ffmpeg5
- ffmpeg6
- ffmpeg7
- ffmpeg -> 最新安装的版本
FFMPEG终极指南:https://img.ly/blog/ultimate-guide-to-ffmpeg/
如何检查支持的格式和编码器
参考:https://dev.to/drsensor/list-of-helpful-ffmpeg-command-for-checking-capabilities-1110
如何列出所有过滤器选项:
$ ffmpeg7 -hide_banner -filters
Filters:
T.. = Timeline support
.S. = Slice threading
..C = Command support
A = Audio input/output
V = Video input/output
N = Dynamic number and/or type of input/output
| = Source or sink filter
T.. adelay A->A Delay one or more audio channels.
... aecho A->A Add echoing to the audio.
...
如何列出硬件加速:
$ ffmpeg7 -hide_banner -hwaccels
Hardware acceleration methods:
vaapi
qsv
drm
opencl
如何验证 ffmpeg OpenCL 加速(仅适用于具有较新 Intel 处理器的 DSM >=7):
$ ffmpeg7 -hide_banner -filters | grep opencl
... avgblur_opencl V->V Apply average blur filter
... boxblur_opencl V->V Apply boxblur filter to input video
... colorkey_opencl V->V Turns a certain color into transparency. Operates on RGB colors.
... convolution_opencl V->V Apply convolution mask to input video
... deshake_opencl V->V Feature-point based video stabilization filter
... dilation_opencl V->V Apply dilation effect
... erosion_opencl V->V Apply erosion effect
... nlmeans_opencl V->V Non-local means denoiser through OpenCL
... overlay_opencl VV->V Overlay one video on top of another
... pad_opencl V->V Pad the input video.
... prewitt_opencl V->V Apply prewitt operator
... program_opencl N->V Filter video using an OpenCL program
... remap_opencl VVV->V Remap pixels using OpenCL.
... roberts_opencl V->V Apply roberts operator
... scale_opencl V->V Scale the input video size through OpenCL.
... sobel_opencl V->V Apply sobel operator
... tonemap_opencl V->V Perform HDR to SDR conversion with tonemapping.
... transpose_opencl V->V Transpose input video
... unsharp_opencl V->V Apply unsharp mask to input video
... xfade_opencl VV->V Cross fade one video with another video.
... openclsrc |->V Generate video using an OpenCL program
在 Intel 类型的处理器上,验证硬件加速:
- 对视频设备文件的访问权限是根据每个应用程序授予的。这允许诸如 tvheadend 之类的应用程序在调用 ffmpeg 时被授予使用硬件加速的访问权限。
作为默认用户,您必须以已授予访问权限的用户身份与 ffmpeg 交互(请参见下面的示例),或者将您的用户帐户添加到 videodriver 组。
$ sudo su -s /bin/bash sc-ffmpeg7 -c '/var/packages/synocli-videodriver/target/bin/vainfo' Trying display: drm libva info: VA-API version 1.22.0 libva info: Trying to open /var/packages/synocli-videodriver/target/lib/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_22 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.22 (libva 2.22.0) vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (a20bb2e) vainfo: Supported profile and entrypoints VAProfileNone : VAEntrypointVideoProc VAProfileNone : VAEntrypointStats VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointFEI VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointFEI VAProfileH264High : VAEntrypointEncSliceLP VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointFEI VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointFEI VAProfileHEVCMain10 : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD
请注意,较旧的 Intel 处理器将回退到 vainfo 输出的旧版 i965 驱动程序部分:
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.4.1
如果访问受限或不存在,例如在虚拟 DSM 上:
$ vainfo
Trying display: drm
error: failed to initialize display
如何验证 OpenCL 硬件加速(下面的截断输出 - 仅适用于具有较新 Intel 处理器的 DSM >=7):
$ sudo su -s /bin/bash sc-ffmpeg7 -c '/var/packages/synocli-videodriver/target/bin/clinfo'
Number of platforms 1
Platform Name Intel(R) OpenCL Graphics
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 3.0
Platform Profile FULL_PROFILE
...
如何列出编码器|解码器|编解码器
$ ffmpeg7 -hide_banner -encoders
$ ffmpeg7 -hide_banner -decoders
$ ffmpeg7 -hide_banner -codecs
如何列出特定编码器|解码器|编解码器的详细信息
$ ffmpeg7 -hide_banner -h encoder=<encoder>
$ ffmpeg7 -hide_banner -h decoder=<decoder>
HEVC 示例:
$ ffmpeg7 -hide_banner -h decoder=hevc
Decoder hevc [HEVC (High Efficiency Video Coding)]:
General capabilities: dr1 delay threads
Threading capabilities: frame and slice
Supported hardware devices: vaapi
HEVC decoder AVOptions:
-apply_defdispwin <boolean> .D.V....... Apply default display window from VUI (default false)
-strict-displaywin <boolean> .D.V....... stricly apply default display window size (default false)
VVC 示例(ffmpeg7 的新功能):
$ ffmpeg7 -hide_banner -h decoder=vvc
Decoder vvc [VVC (Versatile Video Coding)]:
General capabilities: dr1 delay exp threads
Threading capabilities: other
x265特定
对于 HEVC 中的 10 位支持等特定功能:
$ /var/packages/ffmpeg7/target/bin/x265 -V -D10
x265 [info]: HEVC encoder version 3.6+1-aa7f602f7
x265 [info]: build info [Linux][GCC 8.5.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
请在线搜索您的需求,您应该找到要运行的命令来获得您的具体答案。
如何在 VideoStation 中使用 SynoCommunity FFmpeg
警告:未经测试,如果您不知道这些命令的作用,可能会造成损坏。
https://gist.github.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e
sudo mv /var/packages/VideoStation/target/bin/ffmpeg /var/packages/VideoStation/target/bin/ffmpeg.old
# /var/packages/ffmpeg/target/bin/ffmpeg 这个路径按照自己安装的版本修改 比如 ...ffmpeg7/target...
sudo ln -sf /var/packages/ffmpeg/target/bin/ffmpeg /var/packages/VideoStation/target/bin/ffmpeg
sudo cp -p /var/packages/VideoStation/target/lib/libsynovte.so /var/packages/VideoStation/target/lib/libsynovte.so.old
sudo sed -i 's/eac3/ZXXZ/' /var/packages/VideoStation/target/lib/libsynovte.so
sudo sed -i 's/dts/ZXZ/' /var/packages/VideoStation/target/lib/libsynovte.so
sudo sed -i 's/truehd/ZXZZXZ/' /var/packages/VideoStation/target/lib/libsynovte.so
撤消上述更改:
sudo mv -f /var/packages/VideoStation/target/bin/ffmpeg.old /var/packages/VideoStation/target/bin/ffmpeg
sudo mv -f /var/packages/VideoStation/target/lib/libsynovte.so.old /var/packages/VideoStation/target/lib/libsynovte.so
(感谢 @GermanChap)
最近的 VideoStation 版本不再原生加载 SynoCommunity ffmpeg 库。 有一个基于以前的 Gist 的维护自动补丁程序:https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
本站转载、机器翻译日期:2024.10.5 版本:41a954f
此修补程序旨在通过使用ffmpeg套件替换VideoStation中的ffmpeg库文件来支持DTS、EAC3和TrueHD。 #####DSM6.x请提前安装ffmpeg套件!!! #####DSM7.x请....
仅适用于X86_64的黑群晖7.0-7.2机型,目前测试识别正常,索引期间CPU占用率也不高。 原理修改为不调用GPU显卡,只用CPU,所以不算完美!仅测试了DS918+、....