FFMPEG-视频中带有飞溅图像的绿色投射

问题描述 投票:0回答:1

我正在使用FFMPEG制作包含单个单色JPG图像的视频:

ffmpeg -y -loop 1 -framerate 30 -t 5 -i SplashBW.jpg Splash.mp4

产生的视频有两个问题:

  • 使用VLC观看时,它呈绿色投射
  • [当使用“电影和电视”观看时(我怀疑这是Windows 10查看器-MP4文件的关联似乎已被劫持在我的PC上)显示为绿色,并且每次闪烁时0.5秒左右。

[使用Irfan View观看时看起来不错。我不知道问题出在原始JPG,FFMPEG命令还是观众。自然,我希望它能在所有输出上正确呈现。

下面的前两个链接在我的浏览器(Chrome)中打开时看起来不错。第三个链接是我尝试使用Film and TV app播放视频时看到的内容的屏幕记录。

B&W image

Resulting video

screen grab of video playing on my PC

FFMPEG运行的日志:

C:\Users\Raymond\Desktop\Chorus\Videos\Virtual Choir>call ffmpeg -y -loglevel verbose -loop 1 -framerate 30 -t 5 -i SplashBW.jpg Splash.mp4
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  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-libope
ncore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuv
id --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  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
[AVIOContext @ 000001e6f6ccdd00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6ccde80] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6d59b00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6ccde40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6ccdf00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6ccdfc0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cce180] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cce240] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd33c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd3480] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd3640] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd3700] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 19 times
Input #0, image2, from 'SplashBW.jpg':
  Duration: 00:00:00.03, start: 0.000000, bitrate: 38348 kb/s
    Stream #0:0: Video: mjpeg (Baseline), 1 reference frame, gray(bt470bg/unknown/unknown, center), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 000001e6f6cd2ec0] w:1920 h:1080 pixfmt:gray tb:1/30 fr:30/1 sar:1/1 sws_param:flags=2
[libx264 @ 000001e6f6d57100] using SAR=1/1
[libx264 @ 000001e6f6d57100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001e6f6d57100] profile High, level 4.0, 4:0:0, 8-bit
[libx264 @ 000001e6f6d57100] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chro
ma_me=0 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weigh
tb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Splash.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264), 1 reference frame (avc1 / 0x31637661), gray(center), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[AVIOContext @ 000001e6f8b98e00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5980] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeksspeed=   0x
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks1.0kbits/s speed=0.359x
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks0.3kbits/s speed=0.828x
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd51c0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5580] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5840] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks0.2kbits/s speed=1.16x
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 2 times
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5300] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5440] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5700] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5980] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
    Last message repeated 1 times
[AVIOContext @ 000001e6f6cd5040] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd4f00] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5c40] Statistics: 159785 bytes read, 0 seeks
[AVIOContext @ 000001e6f6cd5ac0] Statistics: 159785 bytes read, 0 seeks
No more output streams to write to, finishing.
frame=  150 fps= 51 q=-1.0 Lsize=     142kB time=00:00:04.90 bitrate= 237.8kbits/s speed=1.65x
video:140kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.855892%
Input file #0 (SplashBW.jpg):
  Input stream #0:0 (video): 151 packets read (24127535 bytes); 151 frames decoded;
  Total: 151 packets (24127535 bytes) demuxed
Output file #0 (Splash.mp4):
  Output stream #0:0 (video): 150 frames encoded; 150 packets muxed (143004 bytes);
  Total: 150 packets (143004 bytes) muxed
[AVIOContext @ 000001e6f6d59240] Statistics: 2 seeks, 4 writeouts
[libx264 @ 000001e6f6d57100] frame I:1     Avg QP:18.13  size:131209
[libx264 @ 000001e6f6d57100] frame P:38    Avg QP:16.03  size:    87
[libx264 @ 000001e6f6d57100] frame B:111   Avg QP:24.33  size:    70
[libx264 @ 000001e6f6d57100] consecutive B-frames:  1.3%  0.0%  0.0% 98.7%
[libx264 @ 000001e6f6d57100] mb I  I16..4:  1.8% 96.0%  2.2%
[libx264 @ 000001e6f6d57100] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.9%
[libx264 @ 000001e6f6d57100] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0:21.7% L1:78.3% BI: 0.0%
[libx264 @ 000001e6f6d57100] 8x8 transform intra:96.0% inter:98.7%
[libx264 @ 000001e6f6d57100] coded y intra: 94.7% inter: 0.0%
[libx264 @ 000001e6f6d57100] i16 v,h,dc,p: 24% 37%  5% 34%
[libx264 @ 000001e6f6d57100] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 22% 11%  3%  3%  3%  4%  3%  5%
[libx264 @ 000001e6f6d57100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 79%  9%  2%  1%  2%  1%  4%  1%  1%
[libx264 @ 000001e6f6d57100] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 000001e6f6d57100] Weighted P-Frames: Y:0.0%
[libx264 @ 000001e6f6d57100] ref P L0: 96.6%  0.7%  1.3%  1.3%
[libx264 @ 000001e6f6d57100] ref B L0: 96.9%  2.1%  1.0%
[libx264 @ 000001e6f6d57100] ref B L1: 94.8%  5.2%
[libx264 @ 000001e6f6d57100] kb/s:227.72
[AVIOContext @ 000001e6f6ccb880] Statistics: 32768 bytes read, 0 seeks

[我正在使用FFMPEG来制作包含单个单色JPG图像的视频:ffmpeg -y -loop 1 -framerate 30 -t 5 -i SplashBW.jpg Splash.mp4产生的视频有两个问题:何时。 ..

ffmpeg jpeg monochrome
1个回答
0
投票

您的输入图像只有一个分量通道-亮度。大多数播放器处理包含三个分量通道的H.264流-亮度或“亮度”(Y),两个色度或“颜色”(U&V)。当H.264编码器对仅亮度流进行编码时,它使用许多播放器不能很好处理的语法来存储它。因此,我们告诉ffmpeg在将色度分量发送到编码器之前,先添加具有中性值(因为源中没有颜色价)的色度分量。我们将添加YUV编码的最常见形式-yuv420p。

© www.soinside.com 2019 - 2024. All rights reserved.