首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用FFMPEG从转码h264_qsv?

如何使用FFMPEG从转码h264_qsv?
EN

Stack Overflow用户
提问于 2020-12-26 13:28:01
回答 2查看 599关注 0票数 0

我试图使用qsv将一个Apple Prores 444转换为H.264,但没有成功。

如果我使用这个命令行:

ffmpeg -i 10minute_Pipeline_Test.mov -c:v h264_qsv -c:a aac -pix_fmt qsv chris.mp4

我得到:

代码语言:javascript
运行
复制
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-nonfree --enable-libmfx
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10minute_Pipeline_Test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537134592
    compatible_brands: qt  
    creation_time   : 2020-12-19T12:43:38.000000Z
    com.apple.quicktime.author: 
    com.apple.quicktime.comment: 
    com.apple.quicktime.copyright: 
    com.apple.quicktime.description: 
    com.apple.quicktime.director: 
    com.apple.quicktime.genre: 
    com.apple.quicktime.information: 
    com.apple.quicktime.keywords: 
    com.apple.quicktime.producer: 
    com.apple.quicktime.displayname: 
    timecode        : 12:43:37;28
  Duration: 00:10:06.72, start: 0.000000, bitrate: 167429 kb/s
    Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 1970-01-04T00:49:14.000000Z
      timecode        : 12:43:37;28
    Stream #0:1(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, GBR, progressive), 1280x720, 164985 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:04.000000Z
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2003-10-05T11:26:56.000000Z
File 'chris.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (prores (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_qsv @ 0x56265b81a800] Selected ratecontrol mode is unsupported
[h264_qsv @ 0x56265b81a800] Low power mode is unsupported
[h264_qsv @ 0x56265b81a800] Current frame rate is unsupported
[h264_qsv @ 0x56265b81a800] Current picture structure is unsupported
[h264_qsv @ 0x56265b81a800] Current resolution is unsupported
[h264_qsv @ 0x56265b81a800] Current pixel format is unsupported
[h264_qsv @ 0x56265b81a800] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
user@NUC:~$ ffmpeg -i 10minute_Pipeline_Test.mov -c:v h264_qsv -c:a aac -pix_fmt qsv  chris.mp4
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-nonfree --enable-libmfx
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10minute_Pipeline_Test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537134592
    compatible_brands: qt  
    creation_time   : 2020-12-19T12:43:38.000000Z
    com.apple.quicktime.author: 
    com.apple.quicktime.comment: 
    com.apple.quicktime.copyright: 
    com.apple.quicktime.description: 
    com.apple.quicktime.director: 
    com.apple.quicktime.genre: 
    com.apple.quicktime.information: 
    com.apple.quicktime.keywords: 
    com.apple.quicktime.producer: 
    com.apple.quicktime.displayname: 
    timecode        : 12:43:37;28
  Duration: 00:10:06.72, start: 0.000000, bitrate: 167429 kb/s
    Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 1970-01-04T00:49:14.000000Z
      timecode        : 12:43:37;28
    Stream #0:1(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, GBR, progressive), 1280x720, 164985 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:04.000000Z
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2003-10-05T11:26:56.000000Z
File 'chris.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (prores (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:1
Conversion failed!

如果我用:

ffmpeg -i 10minute_Pipeline_Test.mov -c:v h264_qsv -c:a aac chris.mp4

我得到:

代码语言:javascript
运行
复制
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-nonfree --enable-libmfx
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10minute_Pipeline_Test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537134592
    compatible_brands: qt  
    creation_time   : 2020-12-19T12:43:38.000000Z
    com.apple.quicktime.author: 
    com.apple.quicktime.comment: 
    com.apple.quicktime.copyright: 
    com.apple.quicktime.description: 
    com.apple.quicktime.director: 
    com.apple.quicktime.genre: 
    com.apple.quicktime.information: 
    com.apple.quicktime.keywords: 
    com.apple.quicktime.producer: 
    com.apple.quicktime.displayname: 
    timecode        : 12:43:37;28
  Duration: 00:10:06.72, start: 0.000000, bitrate: 167429 kb/s
    Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 1970-01-04T00:49:14.000000Z
      timecode        : 12:43:37;28
    Stream #0:1(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, GBR, progressive), 1280x720, 164985 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:04.000000Z
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2003-10-05T11:26:56.000000Z
File 'chris.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (prores (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:1
Conversion failed!
user@NUC:~$ ffmpeg -i 10minute_Pipeline_Test.mov -c:v h264_qsv -c:a aac  chris.mp4
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-nonfree --enable-libmfx
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10minute_Pipeline_Test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537134592
    compatible_brands: qt  
    creation_time   : 2020-12-19T12:43:38.000000Z
    com.apple.quicktime.author: 
    com.apple.quicktime.comment: 
    com.apple.quicktime.copyright: 
    com.apple.quicktime.description: 
    com.apple.quicktime.director: 
    com.apple.quicktime.genre: 
    com.apple.quicktime.information: 
    com.apple.quicktime.keywords: 
    com.apple.quicktime.producer: 
    com.apple.quicktime.displayname: 
    timecode        : 12:43:37;28
  Duration: 00:10:06.72, start: 0.000000, bitrate: 167429 kb/s
    Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 1970-01-04T00:49:14.000000Z
      timecode        : 12:43:37;28
    Stream #0:1(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, GBR, progressive), 1280x720, 164985 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:04.000000Z
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2003-10-05T11:26:56.000000Z
File 'chris.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (prores (native) -> h264 (h264_qsv))
  Stream #0:2 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_qsv @ 0x55b3bb6e8800] Selected ratecontrol mode is unsupported
[h264_qsv @ 0x55b3bb6e8800] Low power mode is unsupported
[h264_qsv @ 0x55b3bb6e8800] Current frame rate is unsupported
[h264_qsv @ 0x55b3bb6e8800] Current picture structure is unsupported
[h264_qsv @ 0x55b3bb6e8800] Current resolution is unsupported
[h264_qsv @ 0x55b3bb6e8800] Current pixel format is unsupported
[h264_qsv @ 0x55b3bb6e8800] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

我什么都找不到了。我可以在没有问题的情况下对其他h264文件进行代码转换。我似乎无法转换这个prores文件的代码。

这里有一个源文件的链接,如果有人能帮忙的话,我会很感激的.

https://www.dropbox.com/s/ejrfzad20yzaifm/10minute_Pipeline_Test.mov?dl=1

EN

Stack Overflow用户

发布于 2022-09-27 15:25:57

我每天使用H264_QSV,我发现您必须声明QSV设备是可用的。

试试这个:

代码语言:javascript
运行
复制
ffmpeg -err_detect ignore_err -hide_banner -loglevel verbose -init_hw_device qsv:qsv,child_device_type=qsv ^ -hwaccel qsv -hwaccel_output_format qsv -i "input.mov" -q:v 30 -preset slow -c:a aac output.mp4

可以添加更多的选项来提高效率、更改质量( -q:v设置)等等。

我发现QSV加速了很多事情,所以您可以使用一个慢的或非常慢的-preset来为给定的质量设置获得更多的压缩,而不会显着地增加转换文件所需的时间。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65456873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档