gpt4 book ai didi

ffmpeg - 使用 ffmpeg 将 EXR 转换为 mp4 时出错

转载 作者:行者123 更新时间:2023-12-04 23:12:26 29 4
gpt4 key购买 nike

我正在使用 ffmpeg 4.3.1 将一些 EXR 转换为 mp4,并使用源中扩展范围的色调映射和 mp4 的 rec709 转换。
我正在使用这个命令:

ffmpeg -pattern_type glob  -framerate 24 -i 'frames/*.exr' -vf zscale=transfer=linear,tonemap=hable,zscale=transfer=bt709,format=yuv420p -c:v libx264 -r 24 -preset slow -crf 18 -pix_fmt yuv420p foo-tonemap-01.mp4
但它给了我这个错误:
Input #0, image2, from 'frames/*.exr':
Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
Stream #0:0: Video: exr, gbrapf32le, 1920x1080 [SAR 1:1 DAR 16:9], 24 tbr, 24 tbn, 24 tbc
Stream mapping:
Stream #0:0 -> #0:0 (exr (native) -> h264 (libx264))
code 3074: no path between colorspaces
Error while filtering: Generic error in an external library
那个错误“颜色空间之间没有路径”是什么意思?我是否需要告诉它 EXR 所在的色彩空间(场景线性 RGB)或其他什么?
完整的日志:
ffmpeg started on 2020-08-05 at 22:22:33
Report written to "ffmpeg-20200805-222233.log"
Log level: 48
Command line:
ffmpeg -report -y -i frames/0240.exr -vf "zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p" -c:v libx264 -r 24 -preset slow -crf 18 -pix_fmt yuv420p foo-tonemap-01.mp4
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input url with argument 'frames/0240.exr'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '24'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '18'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option 'foo-tonemap-01.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url frames/0240.exr.
Successfully parsed a group of options.
Opening an input file: frames/0240.exr.
[NULL @ 0x6db71c0] Opening 'frames/0240.exr' for reading
[file @ 0x6db7c80] Setting default whitelist 'file,crypto,data'
[exr_pipe @ 0x6db71c0] Format exr_pipe probed with size=2048 and score=51
[exr_pipe @ 0x6db71c0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[exr_pipe @ 0x6db71c0] parser not found for codec exr, packets or times may be invalid.
[exr_pipe @ 0x6db71c0] parser not found for codec exr, packets or times may be invalid.
[exr @ 0x6db92c0] line order: 0.
[exr_pipe @ 0x6db71c0] After avformat_find_stream_info() pos: 4970635 bytes read:4970635 seeks:0 frames:1
Input #0, exr_pipe, from 'frames/0240.exr':
Duration: N/A, bitrate: N/A
Stream #0:0, 1, 1/25: Video: exr, gbrapf32le, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url foo-tonemap-01.mp4.
Applying option vf (set video filters) with argument zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p.
Applying option c:v (codec name) with argument libx264.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 24.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Successfully parsed a group of options.
Opening an output file: foo-tonemap-01.mp4.
[file @ 0x6e0a0c0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
detected 32 logical cores
Stream mapping:
Stream #0:0 -> #0:0 (exr (native) -> h264 (libx264))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[exr @ 0x6dbe700] line order: 0.
[Parsed_zscale_0 @ 0x725c4c0] Setting 'transfer' to value 'linear'
[Parsed_tonemap_1 @ 0x725c940] Setting 'tonemap' to value 'clip'
[Parsed_zscale_2 @ 0x725d380] Setting 'transfer' to value 'bt709'
[Parsed_format_3 @ 0x725e100] Setting 'pix_fmts' to value 'yuv420p'
[graph 0 input from stream 0:0 @ 0x725eb40] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x725eb40] Setting 'pix_fmt' to value '180'
[graph 0 input from stream 0:0 @ 0x725eb40] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x725eb40] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x725eb40] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x725eb40] w:1920 h:1080 pixfmt:gbrapf32le tb:1/25 fr:25/1 sar:1/1
[format @ 0x725fc00] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0x6dc0000] query_formats: 7 queried, 6 merged, 0 already done, 0 delayed
[Parsed_zscale_0 @ 0x725c4c0] w:1920 h:1080 fmt:gbrapf32le sar:1/1 -> w:1920 h:1080 fmt:gbrapf32le sar:1/1
[Parsed_zscale_2 @ 0x725d380] w:1920 h:1080 fmt:gbrapf32le sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1
[Parsed_zscale_0 @ 0x725c4c0] w:1920 h:1080 fmt:gbrapf32le sar:1/1 -> w:1920 h:1080 fmt:gbrapf32le sar:1/1
code 3074: no path between colorspaces
Error while filtering: Generic error in an external library
Failed to inject frame into filter network: Generic error in an external library
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x6e08a80] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x6dc00c0] Statistics: 4970635 bytes read, 0 seeks
Conversion failed!

最佳答案

我刚刚偶然发现了同样的问题,这就是我发现的:
你是对的,你需要告诉 ffmpeg 在 EXR 中使用什么颜色配置文件——即使它们是线性 RGB 是相当标准的。
因此,这是您需要在输入之前添加的内容:

-color_trc linear -color_range pc -color_primaries bt709 -colorspace rgb -i yourFile.exr
  • -color_trc : 转账, linear , 明显地。
  • -color_range : 个人电脑/完整。
  • -color_primaries : bt709 ,实际上与RGB相同。
  • -colorspace : 我相信这是白点,因为它有 rgb选项也很明显。
  • 关于ffmpeg - 使用 ffmpeg 将 EXR 转换为 mp4 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63274056/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com