20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式

这篇具有很好参考价值的文章主要介绍了20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式
2023/4/3 15:50


最近向学习日语,找到日语发音的视频中,大多数是MP4格式,少量是WMV格式,PR2023貌似不能识别WMV格式。
于是:万能的ffmpeg上场了!

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式

 


手动指定编解码器
通过 ffmpeg -codecs | findstr "vc1" 查看 vc1 的编解码器
可以看到有 i卡 专用的 vc1_qsv 和 N卡 专用的 vc1_cuivid 解码器

加入参数-c:v来指定解码器:ffmpeg -c:v vc1_cuvid -i input2.wmv -c:v h264_nvenc output.mp4 (根据你的显卡选择对应的编解码器,我这里是 N卡 所以选择了 vc1_cuvid 作为解码器,h264_nvenc 作为编码器)

可以看到转码速度非常快,并且硬件编解码器也得到了充分的利用,CPU 占用也较低。


同样也是注意 nvenc 默认编码输出为 2000k 码率,可以手动设置码率来降低画质损失。


ffmpeg -c:v vc1_cuvid -i input2.wmv -c:v h264_nvenc output.mp4

C:\Users\Sun>cd G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067

C:\Users\Sun>g:

G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067>
G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067>dir
 驱动器 G 中的卷是 18680688682
 卷的序列号是 2A59-69C0

 G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067 的目录

2023/03/18  19:03    <DIR>          .
2023/03/18  19:03    <DIR>          ..
2023/03/18  19:03           137,393 TEK-067.jpg
2023/03/17  10:46     7,785,976,422 TEK-067.wmv
               2 个文件  7,786,113,815 字节
               2 个目录 133,153,181,696 可用字节

G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067>ffmpeg -c:v vc1_cuvid -i TEK-067.wmv  -c:v h264_nvenc d:\2.mp4
ffmpeg version git-2020-06-28-4cfcfb3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 93.100 / 58. 93.100
  libavformat    58. 47.100 / 58. 47.100
  libavdevice    58. 11.100 / 58. 11.100
  libavfilter     7. 86.100 /  7. 86.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, asf, from 'TEK-067.wmv':
  Metadata:
    copyright       : MUTEKI
    DeviceConformanceTemplate: AP@L3
    WM/WMADRCPeakReference: 32767
    WM/WMADRCPeakTarget: 32767
    WM/WMADRCAverageReference: 3283
    WM/WMADRCAverageTarget: 3283
    artist          : MUTEKI
    IsVBR           : 0
    WMFSDKNeeded    : 0.0.0.0000
    WMFSDKVersion   : 12.0.7601.17514
  Duration: 02:56:19.69, start: 0.000000, bitrate: 5887 kb/s
    Stream #0:0(jpn): Audio: wmapro (b[1][0][0] / 0x0162), 44100 Hz, stereo, fltp, 256 kb/s
    Stream #0:1(jpn): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 5744 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (vc1 (vc1_cuvid) -> h264 (h264_nvenc))
  Stream #0:0 -> #0:1 (wmapro (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'd:\2.mp4':
  Metadata:
    copyright       : MUTEKI
    DeviceConformanceTemplate: AP@L3
    WM/WMADRCPeakReference: 32767
    WM/WMADRCPeakTarget: 32767
    WM/WMADRCAverageReference: 3283
    WM/WMADRCAverageTarget: 3283
    artist          : MUTEKI
    IsVBR           : 0
    WMFSDKNeeded    : 0.0.0.0000
    WMFSDKVersion   : 12.0.7601.17514
    encoder         : Lavf58.47.100
    Stream #0:0(jpn): Video: h264 (h264_nvenc) (Main) (avc1 / 0x31637661), nv12(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.93.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
    Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.93.100 aac
[aac @ 000001804f1195c0] Queue input is backward in time.94 bitrate=1954.7kbits/s speed=6.95x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 508373, current: 507900; changing to 508374. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.08 bitrate=2291.3kbits/s speed=7.56x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 2442202, current: 2441200; changing to 2442203. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.32 bitrate=2222.9kbits/s speed=8.25x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 9405416, current: 9403840; changing to 9405417. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 9405417, current: 9404864; changing to 9405418. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.36 bitrate=2137.0kbits/s speed=8.08x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 12993524, current: 12992477; changing to 12993525. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 12993525, current: 12993501; changing to 12993526. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.16 bitrate=2195.6kbits/s speed=7.77x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 30819293, current: 30818271; changing to 30819294. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.65 bitrate=2178.4kbits/s speed=7.88x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 39093227, current: 39092180; changing to 39093228. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 39093228, current: 39093204; changing to 39093229. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.19 bitrate=2189.7kbits/s speed= 7.9x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 40715225, current: 40714223; changing to 40715226. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.89 bitrate=2210.5kbits/s speed=6.41x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 84823029, current: 84821984; changing to 84823030. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 84823030, current: 84823008; changing to 84823031. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.48 bitrate=2189.7kbits/s speed=6.27x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93422573, current: 93421528; changing to 93422574. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93422574, current: 93422552; changing to 93422575. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.48 bitrate=2189.6kbits/s speed=6.27x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93619173, current: 93617597; changing to 93619174. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93619174, current: 93618621; changing to 93619175. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.35 bitrate=2188.6kbits/s speed=6.27x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93668344, current: 93666768; changing to 93668345. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93668345, current: 93667792; changing to 93668346. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.62 bitrate=2189.1kbits/s speed=6.26x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93897708, current: 93896662; changing to 93897709. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 93897709, current: 93897686; changing to 93897710. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.20 bitrate=2188.1kbits/s speed=6.26x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 94405608, current: 94404605; changing to 94405609. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.54 bitrate=2186.4kbits/s speed=6.25x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 94831589, current: 94830567; changing to 94831590. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.51 bitrate=2185.3kbits/s speed=6.25x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 94946274, current: 94945271; changing to 94946275. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.58 bitrate=2185.2kbits/s speed=6.25x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 94995445, current: 94994399; changing to 94995446. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 94995446, current: 94995423; changing to 94995447. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.39 bitrate=2183.1kbits/s speed=6.24x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 95241215, current: 95240168; changing to 95241216. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 95241216, current: 95241192; changing to 95241217. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time.76 bitrate=2193.1kbits/s speed=6.21x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 98436078, current: 98435037; changing to 98436079. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 98436079, current: 98436061; changing to 98436080. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time2.88 bitrate=2200.1kbits/s speed=7.11x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 215712746, current: 215711710; changing to 215712747. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 215712747, current: 215712734; changing to 215712748. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time1.08 bitrate=2196.4kbits/s speed=7.12x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 216945622, current: 216944614; changing to 216945623. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time6.74 bitrate=2197.6kbits/s speed=7.14x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 221201399, current: 221200352; changing to 221201400. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 221201400, current: 221201376; changing to 221201401. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time5.43 bitrate=2213.6kbits/s speed=7.43x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 316339164, current: 316338164; changing to 316339165. This may result in incorrect timestamps in the output file.
[aac @ 000001804f1195c0] Queue input is backward in time3.78 bitrate=2203.3kbits/s speed=7.44x
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 321651673, current: 321650141; changing to 321651674. This may result in incorrect timestamps in the output file.
[mp4 @ 000001804f5a3580] Non-monotonous DTS in output stream 0:1; previous: 321651674, current: 321651165; changing to 321651675. This may result in incorrect timestamps in the output file.
frame=317078 fps=229 q=24.0 Lsize= 2851835kB time=02:56:19.80 bitrate=2208.2kbits/s dup=6 drop=0 speed=7.64x
video:2677348kB audio:165245kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.325136%
[aac @ 000001804f1195c0] Qavg: 521.184

G:\迅雷下载\三上悠亚(三上悠亜-Mikami Yua)\TEK-067>

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式 

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式 

 


转码过程中,CPU和GPU的消耗都比较大,可能是我用的电脑比较古老/经典吧!

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式

20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式 

 


参考资料:
https://blog.csdn.net/ramondq/article/details/127803494
ffmpeg 硬件加速 wmv 视频转码
kotlean已于 2022-12-22 22:41:39 修改文章来源地址https://www.toymoban.com/news/detail-421057.html

到了这里,关于20230403在WIN10下通过ffmpeg调用NVIDIA的硬件加速wmv视频转码为MP4格式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ffmpeg 硬件加速介绍

    参考[2],基于windows的硬件加速都是基于DirectX API,我们可以用ffmpeg -hwaccels查看当前环境支持的硬件加速接口,如下为windows上的执行ffmpeg --hwaccels的结果。 在linux上执行ffmpeg -hwaccels的结果如下: 可以看到windows上支持的硬件加速接口比较多,其中dxva2,d3d11va都为DirectX的硬件加

    2024年02月21日
    浏览(35)
  • nvidia jetson 平台使用 ffmpeg nvmpi 硬件编解码

    首先目前ffmpeg不支持在nvidia jetson 平台上进行使用硬件编解码加速,但是由于nvidia 提供了相对的硬件编解码加速的api,故可以将api集成到ffmpeg实现。 好在国外大神多,在github上已经有人实现了。 GitHub - jocover/jetson-ffmpeg: ffmpeg support on jetson nano 这个是实现的jetson api 的c++ 工程,

    2024年02月16日
    浏览(49)
  • ffmpeg 硬件加速视频转码指南

    0. 系统环境 基于 Windows 下演示,Linux 下也可以适用。 所使用 ffmpeg 版本为 BtbN 编译的 win64-gpl 版(非 gpl-share),项目地址:BtbN / FFmpeg-Builds 也可以使用 gyan.dev 编译的 git-full 版,地址:gyan.dev ,都是官方推荐的。 所使用的测试片段是一段相机录制的 h264 编码的100兆码率的

    2024年01月19日
    浏览(40)
  • 使用GPU硬件加速FFmpeg视频转码

    本文内容包括: 在Linux环境下安装FFmpeg 通过命令行实现视频格式识别和转码 有Nvidia显卡的情况下,在Linux下使用GPU进行视频转码加速的方法 在FFmpeg官网https://ffmpeg.org/download.html可以下载到ubunto/debian的发行包,其他Linux发行版需自行编译。同时,如果要使用GPU进行硬件加速的话

    2024年02月08日
    浏览(46)
  • ffmpeg学习 源代码编译、英伟达硬件加速

    使用cpu进行软编解码时,cpu效率低并且占用高。使用硬件加速,能够明显降低CPU的占用,参看博客 ffmpeg学习(16)AVDevice使用。 这里以使用英伟达gpu进行h264编解码加速为例说明,其他平台类似。 在windows平台直接下载官方的预编译ffmpeg、lib开发包,都已经支持了英伟达显卡硬

    2023年04月09日
    浏览(42)
  • 02.FFMPEG的安装和添加硬件加速自编译

    说一个极其郁闷的事情,就在昨天收到3399的一块板子后,往电脑上面一插,然后悲剧的事情就发生了,我的电脑蓝屏重启了,这下好了,我写到一半的帖子也不见了,我的SSH里面的记录全部消失了,最关键的是SSH还没有退出,所以查询bash_history都查询不到,无语泪凝咽。所以

    2024年02月12日
    浏览(49)
  • Ubuntu 18.04 安装ffmpeg(支持GPU硬件加速)

    1:安装前请自行安装nvidia驱动和cudu cudnn 查看cuda版本 2:安装nv-codec-hearers 官网: https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/ 3:安装ffmpeg编码库 4:安装ffmpeg 5:建立软连接 增加安装目录的动态链接库 6 检查硬件加速 7:添加库连接 8 :运行实例检查 9:卸载

    2023年04月18日
    浏览(113)
  • NDK编译ffmpeg包含硬件加速vulkan和mediacodec

    NDK编译ffmpeg包含硬件加速vulkan和mediacodec flyfish ffmpeg:ffmpeg-6.0 NDK:android-ndk-r25c 硬件加速:vulkan 和 mediacodec target CPU:armv8-a host:Ubuntu 22.04 因为这里要编译硬件加速版本的ffmpeg-6.0,所以需要把vulkan中include下的两个文件夹 vk_video 和 vulkan 拷贝到 android-ndk-r25c/toolchains/llvm/prebuil

    2024年02月12日
    浏览(35)
  • NVIDIA CUDA Win10安装步骤

    前言 windows10 版本安装 CUDA ,首先需要下载两个安装包 CUDA toolkit(toolkit就是指工具包) cuDNN 确认你的显卡已经正确安装,在设备管理器中可以看到NVIDIA显卡的存在。在Windows操作系统中,打开设备管理器的快捷键是:Win + X,然后选择“设备管理器”。 确认你的显卡支持CUDA。

    2024年02月10日
    浏览(38)
  • linux下ffmpeg调用GPU硬件解码(VDPAU/VAAPI)保存文件

    本文讲解在linux下面,如何通过ffmpeg调用GPU硬件解码,并保存解码完的yuv文件。 其实,ffmpeg自带的例子hw_decode.c这个文件,就已经能满足要求了,因此,本文就尝试讲解以下hw_decode这个例子。hw_decode.c可以调用VDPAU硬件解码,也可以调用VAAPI硬件解码,下面依次讲解如何进行操

    2024年02月19日
    浏览(51)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包