![使用 ffmpeg 处理 GoPro 视频时颜色混乱](https://linux22.com/image/1607250/%E4%BD%BF%E7%94%A8%20ffmpeg%20%E5%A4%84%E7%90%86%20GoPro%20%E8%A7%86%E9%A2%91%E6%97%B6%E9%A2%9C%E8%89%B2%E6%B7%B7%E4%B9%B1.png)
我正在尝试使用 FFmpeg 对使用 GoPro Hero3+ 拍摄的视频进行转码。
问题是,任何类型的处理(甚至将单帧转储到 jpg 文件)都会使输出颜色看起来略显暗淡。我尝试使用不同的颜色格式,但结果总是相同的。
FFmpeg 视频流信息如下。原文:
Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 30232 kb/s, 29.97 fps, 29.97 tbr, 180k tbn, 59.94 tbc (default)
处理:
Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 11513 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
例子:
编辑:重现该问题的最简单方法是从视频中转储一帧:
ffmpeg -i GOPR2004.MP4 -ss 00:00:00.000 -vframes 1 output.png
日志:
ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20181127
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR2004.MP4':
Metadata:
major_brand : avc1
minor_version : 0
compatible_brands: avc1isom
creation_time : 2019-09-15T20:28:24.000000Z
firmware : HD3.11.03.03
Duration: 00:00:21.02, start: 0.000000, bitrate: 30802 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 30232 kb/s, 29.97 fps, 29.97 tbr, 180k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2019-09-15T20:28:24.000000Z
handler_name : GoPro AVC
encoder : GoPro AVC encoder
timecode : 20:27:10:10
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
creation_time : 2019-09-15T20:28:24.000000Z
handler_name : GoPro AAC
timecode : 20:27:10:10
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2019-09-15T20:28:24.000000Z
timecode : 20:27:10:10