Exr seqüência de arquivos para mov com ffmpeg

1

Quando eu converto uma seqüência de arquivo EXR com x264 usando FFmpeg e converto o espaço de cores de linear para SRGB (com gama 0,45454545) recebo alguns problemas de faixas pesadas (mais visíveis em um gradiente escuro). Para mim, parece que ele converte o vídeo primeiro e depois aplica a correção gama em vídeo de 8 bits. Em caso afirmativo, é possível converter a seqüência de imagens de linear para srg primeiro e depois convertê-la em Quicktime?

Aqui está o comando ffmpeg que eu uso:

C:/ffmpeg.exe -y -i C:/seq_v001.%04d.exr -vf lutrgb=r=gammaval(0.45454545):g=gammaval(0.45454545):b=gammaval(0.45454545) -vcodec libx264 -pix_fmt yuv420p -preset slow -crf 18 -r 25 C:/out.mov

Aqui está a saída:

ffmpeg version N-47062-g26c531c Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 25 2012 12:25:21 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52.  9.100 / 52.  9.100
  libavcodec     54. 77.100 / 54. 77.100
  libavformat    54. 37.100 / 54. 37.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 23.102 /  3. 23.102
  libswscale      2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc    52.  2.100 / 52.  2.100
Input #0, image2, from 'C:/seq_v001.%04d.exr':
  Duration: 00:00:09.60, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: exr, rgb48le, 960x540 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0000000004d11540] using SAR=1/1
[libx264 @ 0000000004d11540] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0000000004d11540] profile High, level 3.1
[libx264 @ 0000000004d11540] 264 - core 128 r2216 198a7ea - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mov, to 'C:/out.mov':
  Metadata:
    encoder         : Lavf54.37.100
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (exr -> libx264)
Press [q] to stop, [?] for help
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
frame=   16 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
frame=   34 fps= 33 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
frame=   52 fps= 34 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
frame=   68 fps= 34 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
frame=   85 fps= 33 q=23.0 size=      47kB time=00:00:00.44 bitrate= 867.5kbits/s    
Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
frame=  104 fps= 34 q=23.0 size=      94kB time=00:00:01.20 bitrate= 640.3kbits/s    
Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
frame=  121 fps= 34 q=23.0 size=     133kB time=00:00:01.88 bitrate= 577.8kbits/s    
Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
frame=  139 fps= 34 q=23.0 size=     172kB time=00:00:02.60 bitrate= 543.4kbits/s    
Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
frame=  157 fps= 34 q=23.0 size=     213kB time=00:00:03.32 bitrate= 525.6kbits/s    
Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
frame=  175 fps= 34 q=23.0 size=     254kB time=00:00:04.04 bitrate= 516.0kbits/s    
Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
frame=  193 fps= 35 q=23.0 size=     287kB time=00:00:04.76 bitrate= 494.6kbits/s    
Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
frame=  211 fps= 35 q=23.0 size=     332kB time=00:00:05.48 bitrate= 496.4kbits/s    
Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
[exr @ 000000000dffa660] Found more than one compression attribute
[exr @ 000000000dffaaa0] Found more than one compression attribute
[exr @ 000000000dffaf00] Found more than one compression attribute
[exr @ 000000000dffb340] Found more than one compression attribute
[exr @ 000000000dffb7a0] Found more than one compression attribute
[exr @ 000000000dffbbe0] Found more than one compression attribute
[exr @ 000000000dffc040] Found more than one compression attribute
[exr @ 000000000dff8c40] Found more than one compression attribute
[exr @ 000000000dff90c0] Found more than one compression attribute
[exr @ 000000000dff9520] Found more than one compression attribute
[exr @ 000000000dff9960] Found more than one compression attribute
[exr @ 000000000dff9dc0] Found more than one compression attribute
[exr @ 000000000dffa200] Found more than one compression attribute
frame=  228 fps= 34 q=23.0 size=     421kB time=00:00:06.16 bitrate= 559.8kbits/s    
frame=  240 fps= 32 q=-1.0 Lsize=     708kB time=00:00:09.52 bitrate= 609.3kbits/s    

video:705kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.505636%
[libx264 @ 0000000004d11540] frame I:2     Avg QP:15.07  size: 18186
[libx264 @ 0000000004d11540] frame P:73    Avg QP:16.51  size:  3719
[libx264 @ 0000000004d11540] frame B:165   Avg QP:18.38  size:  2502
[libx264 @ 0000000004d11540] consecutive B-frames:  2.5%  3.3% 42.5% 51.7%
[libx264 @ 0000000004d11540] mb I  I16..4: 46.2% 33.3% 20.4%
[libx264 @ 0000000004d11540] mb P  I16..4:  6.8%  2.0%  0.6%  P16..4: 29.4% 10.5%  4.6%  0.0%  0.0%    skip:46.1%
[libx264 @ 0000000004d11540] mb B  I16..4:  1.8%  0.7%  0.2%  B16..8: 40.9%  6.5%  0.3%  direct: 1.2%  skip:48.5%  L0:52.0% L1:47.5% BI: 0.5%
[libx264 @ 0000000004d11540] 8x8 transform intra:24.7% inter:81.3%
[libx264 @ 0000000004d11540] direct mvs  spatial:93.3% temporal:6.7%
[libx264 @ 0000000004d11540] coded y,uvDC,uvAC intra: 10.7% 31.4% 24.9% inter: 2.3% 9.0% 2.9%
[libx264 @ 0000000004d11540] i16 v,h,dc,p: 83% 11%  6%  1%
[libx264 @ 0000000004d11540] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9%  9% 52%  6%  4%  4%  5%  5%  5%
[libx264 @ 0000000004d11540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 11% 44%  5%  4%  3%  3%  4%  3%
[libx264 @ 0000000004d11540] i8c dc,h,v,p: 69% 15% 15%  2%
[libx264 @ 0000000004d11540] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000000004d11540] ref P L0: 48.9%  0.1% 16.8% 17.0% 11.3%  5.8%
[libx264 @ 0000000004d11540] ref B L0: 57.7% 21.9% 13.9%  6.4%
[libx264 @ 0000000004d11540] ref B L1: 82.4% 17.6%
[libx264 @ 0000000004d11540] kb/s:600.61

Alguém tem uma ideia de por onde começar?

    
por user1863947 22.04.2014 / 17:54

3 respostas

1

Oi não sei se consegui tudo, mas fiz alguns testes adicionais. Eu converti um exr com espaço linear e um exr com espaço srgb.

O linear i convertido com ffmpeg em srgb com a seguinte tag:

-vf lutrgb=r=gammaval(0.45454545):g=gammaval(0.45454545):b=gammaval(0.45454545)

e o resultado teve a faixa:

Oquejáerasrgbenãotinhaatag-vflutrgbparecialegal:

Você ainda acha que o problema é a redução de bits porque ambas as imagens de origem tinham exatamente a mesma profundidade de bits? Há algo mais que eu deveria tentar, que poderia levar a uma solução?

@rajib Você não acha que o problema é que a conversão do espaço de cores acontece após a redução de bits. E, claro, a imagem de 8 bits não tem informação suficiente para a conversão do espaço de cores?

Em caso afirmativo, é possível, de alguma forma, empilhar diferentes operações em uma determinada ordem: 1. Não altere a profundidade do bit de entrada ou tenha mais que 8 bits 2. Faça a conversão gamma lut 3. Reduza a profundidade de bits para 8 bits

    
por 24.04.2014 / 10:51
0

Possivelmente você deve converter as imagens de 32 bits em bits menores se desejar usar ffmpeg para salvar um arquivo mov.

Se você está melhor usando Nuke para renderizar para mov. O Nuke é perfeitamente capaz de renderizar para o formato mov, e aplicar a correção de gama em um nó de grade irá converter de espaço linear para sRGB. Os bits também serão "redimensionados" automaticamente quando você salvar em 10 bits ou 8 bits mov .

    
por 23.04.2014 / 22:01
0

Provavelmente um pouco atrasado aqui, mas se alguém mais tiver o mesmo problema.

O problema é que a correção gama é aplicada depois que a imagem inicial do exr já foi carregada. Carregue o exr com o gamma 2.2 para sRGB e não ajuste gamma o vídeo de saída. Além disso, o quicktime é notório para mudanças de gama estranhas, portanto não o use para reproduzir seus vídeos.

C:/ffmpeg.exe -y -gamma 2.2 -i C:/seq_v001.%04d.exr -vcodec libx264 -pix_fmt yuv420p -preset slow -crf 18 -r 25 C:/out.mov
    
por 27.10.2016 / 23:16