[FFmpeg-user] OpenEXR input with cropped data window produces black output

Kevin Wheatley kevin.j.wheatley at gmail.com
Tue Jan 3 13:56:06 EET 2017


Hi,

just wondered if this is a known problem, if I take an Open EXR with a
data window != display window:

exrheader /tmp/exr_test.0001.exr

/tmp/exr_test.0001.exr:

file format version: 2, flags 0x0
channels (type chlist):
    B, 16-bit floating-point, sampling 1 1
    G, 16-bit floating-point, sampling 1 1
    R, 16-bit floating-point, sampling 1 1
compression (type compression): b44a
dataWindow (type box2i): (873 318) - (1174 625)
displayWindow (type box2i): (0 0) - (1919 1079)
lineOrder (type lineOrder): increasing y
nuke/full_layer_names (type int): 0
nuke/node_hash (type string): "39e58529e216c6ab"
nuke/version (type string): "10.0v5"
pixelAspectRatio (type float): 1
screenWindowCenter (type v2f): (0 0)
screenWindowWidth (type float): 1
type (type string): "scanlineimage"
version (type int): 1

and I try encode it to a movie file

ffmpeg -y -loglevel debug -apply_trc linear -i /tmp/exr_test.%04d.exr
-c:v libx264 /tmp/test.mov

I end up with a full frame of black, changing EXR compression type
(none, zip 1, PIZ, etc) or data type (16 bit/32 bit) does not make a
difference, nor does switching to mp4 output container, or using mjpeg
as an codec.

If I use a file where data window and display window are the same I
get the correct output.

Thanks

Kevin


ffmpeg -y -loglevel debug -apply_trc linear -i /tmp/exr_test.%04d.exr
-c:v libx264 /tmp/test.mov
ffmpeg version n3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  configuration:
--extra-ldflags=-L/mnt/scratch/kwheatle/ffmpeg_build/opt/lib
--extra-cflags=-I/mnt/scratch/kwheatle/ffmpeg_build/opt/include
--extra-cxxflags=-I/mnt/scratch/kwheatle/ffmpeg_build/opt/include
--enable-gpl --enable-nonfree --enable-libx264 --enable-libx265
--enable-libvpx --enable-libvorbis --enable-libfreetype
--enable-ffplay --enable-x11grab --enable-libpulse
--prefix=/net/global/opt/ffmpeg/ffmpeg-git.20161220
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files)
with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set
logging level) with argument 'debug'.
Reading option '-apply_trc' ... matched as AVOption 'apply_trc' with
argument 'linear'.
Reading option '-i' ... matched as input url with argument
'/tmp/exr_test.%04d.exr'.
Reading option '-c:v' ... matched as option 'c' (codec name) with
argument 'libx264'.
Reading option '/tmp/test.mov' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url /tmp/exr_test.%04d.exr.
Successfully parsed a group of options.
Opening an input file: /tmp/exr_test.%04d.exr.
[file @ 0x41eb2c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x41eaaa0] Statistics: 80092 bytes read, 0 seeks
[exr @ 0x41ea5c0] line order: 0.
[file @ 0x41eb2c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x41eaac0] Statistics: 78469 bytes read, 0 seeks
Input #0, image2, from '/tmp/exr_test.%04d.exr':
  Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
    Stream #0:0, 2, 1/25: Video: exr, 1 reference frame,
rgb48le(unknown/unknown/linear), 1920x1080 [SAR 1:1 DAR 16:9], 0/1, 25
tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url /tmp/test.mov.
Applying option c:v (codec name) with argument libx264.
Successfully parsed a group of options.
Opening an output file: /tmp/test.mov.
[file @ 0x422c140] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'video_size' to
value '1920x1080'
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'pix_fmt' to value '42'
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'pixel_aspect' to
value '1/1'
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'sws_param' to
value 'flags=2'
[graph 0 input from stream 0:0 @ 0x422c380] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x422c380] w:1920 h:1080
pixfmt:rgb48le tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 0x422cc80] compat: called with
args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21]
[format @ 0x422cc80] Setting 'pix_fmts' to value
'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21'
[auto-inserted scaler 0 @ 0x42299e0] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 0x42299e0] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x422cc80] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x422b740] query_formats: 4 queried, 2 merged, 1
already done, 0 delayed
[auto-inserted scaler 0 @ 0x42299e0] picking yuv444p out of 8
ref:rgb48le alpha:0
[auto-inserted scaler 0 @ 0x42299e0] w:1920 h:1080 fmt:rgb48le sar:1/1
-> w:1920 h:1080 fmt:yuv444p sar:1/1 flags:0x4
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x42287c0] using mv_range_thread = 88
[libx264 @ 0x42287c0] using SAR=1/1
[libx264 @ 0x42287c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x42287c0] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264 @ 0x42287c0] 264 - core 148 r2728 4d5c8b0 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2016 - 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 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4
threads=6 lookahead_threads=1 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 weightb=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, mov, to '/tmp/test.mov':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #0:0, 0, 1/12800: Video: h264 (libx264), 1 reference frame
(avc1 / 0x31637661), yuv444p, 1920x1080 [SAR 1:1 DAR 16:9], 0/1,
q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (exr (native) -> h264 (libx264))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 2 times
[exr @ 0x426afe0] line order: 0.
    Last message repeated 1 times
Clipping frame in rate conversion by 0.000008
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 3 times
[output stream 0:0 @ 0x422c940] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
[libx264 @ 0x42287c0] frame=   0 QP=12.00 NAL=3 Slice:I Poc:0   I:8160
P:0    SKIP:0    size=490 bytes
[libx264 @ 0x42287c0] frame=   1 QP=24.15 NAL=2 Slice:P Poc:2   I:419
P:1    SKIP:7740 size=1002 bytes
frame=    2 fps=0.0 q=-1.0 Lsize=       3kB time=00:00:00.04 bitrate=
597.4kbits/s speed=0.159x
video:2kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 37.293579%
Input file #0 (/tmp/exr_test.%04d.exr):
  Input stream #0:0 (video): 2 packets read (158561 bytes); 2 frames decoded;
  Total: 2 packets (158561 bytes) demuxed
Output file #0 (/tmp/test.mov):
  Output stream #0:0 (video): 2 frames encoded; 2 packets muxed (2180 bytes);
  Total: 2 packets (2180 bytes) muxed
2 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x422ba00] Statistics: 36 seeks, 31 writeouts
[libx264 @ 0x42287c0] frame I:1     Avg QP:12.00  size:   490
[libx264 @ 0x42287c0] frame P:1     Avg QP:24.15  size:  1002
[libx264 @ 0x42287c0] mb I  I16..4:  0.0% 100.0%  0.0%
[libx264 @ 0x42287c0] mb P  I16..4:  4.3%  0.3%  0.5%  P16..4:  0.0%
0.0%  0.0%  0.0%  0.0%    skip:94.9%
[libx264 @ 0x42287c0] 8x8 transform intra:95.4% inter:0.0%
[libx264 @ 0x42287c0] coded y,u,v intra: 0.1% 0.1% 0.1% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x42287c0] i16 v,h,dc,p: 60% 40%  1%  0%
[libx264 @ 0x42287c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%
0%  0%  0%  0%  0%
[libx264 @ 0x42287c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 34% 30%  0%
0%  0%  0%  0%  0%
[libx264 @ 0x42287c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x42287c0] kb/s:149.20


More information about the ffmpeg-user mailing list