Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-17 Thread Andy Furniss

Andy Furniss wrote:

Andreas Hummel wrote:

Hello Kevin, thanks for the hint. I replaced the -colormatrix option
with the -vf scale=.. option you suggested but i'm still getting a
slight hue shift in the final converted movie.

Even the added -sws_flags you suggested thx @Andy couldn't solve the
 problem. I tried various combinations but somehow i can't get a
color correct output with ffmpeg so far.


ffmpeg.exe -loglevel verbose -y -f image2 -start_number 0 -r 25 -i
INPUT -r 25 -vcodec prores_ks -profile:v 3 -pix_fmt yuv422p10le -vf
scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709





-sws_flags accurate_rnd+full_chroma_int+full_chroma_inp+bitexact

-color_primaries bt709 -color_trc bt709 -colorspace bt709 -vendor
ap10 OUTPUT.mov



[Parsed_scale_0 @ 025899a0] w:iw h:ih flags:'bicubic'
interl:0 [graph 0 input from stream 0:0 @ 02587ba0] w:1920
h:1080 pixfmt:gbrp10le tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 0:0 @ 02587ba0] TB:0.04
FRAME_RATE:25.00 SAMPLE_RATE:nan [Parsed_scale_0 @
025899a0] w:1920 h:1080 fmt:gbrp10le sar:1/1 -> w:1920
h:1080 fmt:yuv422p10le sar:1/1 flags:0x4


I can see from that that the -sws_flags didn't take.


More testing - Seems I am wrong here. Appending like I said will
show different, but with loglevel debug you can see the flags do
get set with -sws_flags and md5sum shows the same results.



I don't have your input and like Carl Eugen said the upload site is so
annoying I haven't seen your output either. Even if I had I don't know
how it was made or how good any 10 -> 8 bit conversion was, plus I would
be viewing on a crappy tn panel which likely doesn't even do 8 bit.

I did a test with some 48 bit rgb sgi images

In summary rather than -sws_flags appending below to the scale command

:flags=accurate_rnd+full_chroma_int+full_chroma_inp+bitexact

got a different output for me. I don't know how you would test 10 bit
though as making/displaying jpg involves another conversion, which may
give different output depending on what/what parameters are involved.


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-17 Thread Andy Furniss

Andreas Hummel wrote:

Hello Kevin, thanks for the hint. I replaced the -colormatrix option
with the -vf scale=.. option you suggested but i'm still getting a
slight hue shift in the final converted movie.

Even the added -sws_flags you suggested thx @Andy couldn't solve the
 problem. I tried various combinations but somehow i can't get a
color correct output with ffmpeg so far.


ffmpeg.exe -loglevel verbose -y -f image2 -start_number 0 -r 25 -i
INPUT -r 25 -vcodec prores_ks -profile:v 3 -pix_fmt yuv422p10le -vf
scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709




-sws_flags accurate_rnd+full_chroma_int+full_chroma_inp+bitexact

-color_primaries bt709 -color_trc bt709 -colorspace bt709 -vendor
ap10 OUTPUT.mov



[Parsed_scale_0 @ 025899a0] w:iw h:ih flags:'bicubic'
interl:0 [graph 0 input from stream 0:0 @ 02587ba0] w:1920
h:1080 pixfmt:gbrp10le tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 0:0 @ 02587ba0] TB:0.04
FRAME_RATE:25.00 SAMPLE_RATE:nan [Parsed_scale_0 @
025899a0] w:1920 h:1080 fmt:gbrp10le sar:1/1 -> w:1920
h:1080 fmt:yuv422p10le sar:1/1 flags:0x4


I can see from that that the -sws_flags didn't take.

I don't have your input and like Carl Eugen said the upload site is so
annoying I haven't seen your output either. Even if I had I don't know
how it was made or how good any 10 -> 8 bit conversion was, plus I would
be viewing on a crappy tn panel which likely doesn't even do 8 bit.

I did a test with some 48 bit rgb sgi images

In summary rather than -sws_flags appending below to the scale command

:flags=accurate_rnd+full_chroma_int+full_chroma_inp+bitexact

got a different output for me. I don't know how you would test 10 bit
though as making/displaying jpg involves another conversion, which may
give different output depending on what/what parameters are involved.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-17 Thread Andreas Hummel
Hello Kevin, thanks for the hint. I replaced the -colormatrix option with
the -vf scale=.. option you suggested but i'm still getting a slight hue
shift in the final converted movie.

Even the added -sws_flags you suggested thx @Andy couldn't solve the
problem. I tried various combinations but somehow i can't get a color
correct output with ffmpeg so far.


ffmpeg.exe -loglevel verbose -y -f image2 -start_number 0 -r 25 -i INPUT -r
25 -vcodec prores_ks -profile:v 3 -pix_fmt yuv422p10le -vf
scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709
-sws_flags accurate_rnd+full_chroma_int+full_chroma_inp+bitexact
-color_primaries bt709 -color_trc bt709 -colorspace bt709 -vendor ap10
OUTPUT.mov


The log looks currently like this:
Input #0, image2, from 'INPUT':
  Duration: 00:01:04.48, start: 0.00, bitrate: N/A
Stream #0:0: Video: dpx, 1 reference frame, gbrp10le, 1920x1080 [SAR
1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[Parsed_scale_0 @ 025899a0] w:iw h:ih flags:'bicubic' interl:0
[graph 0 input from stream 0:0 @ 02587ba0] w:1920 h:1080
pixfmt:gbrp10le tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 0:0 @ 02587ba0] TB:0.04
FRAME_RATE:25.00 SAMPLE_RATE:nan
[Parsed_scale_0 @ 025899a0] w:1920 h:1080 fmt:gbrp10le sar:1/1 ->
w:1920 h:1080 fmt:yuv422p10le sar:1/1 flags:0x4
Output #0, mov, to 'OUTPUT.mov':
  Metadata:
encoder : Lavf57.51.103
Stream #0:0: Video: prores (prores_ks), 1 reference frame (apch /
0x68637061), yuv422p10le(bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200
kb/s, 25 fps, 12800 tbn, 25 tbc
Metadata:
  encoder : Lavc57.61.102 prores_ks
Stream mapping:
  Stream #0:0 -> #0:0 (dpx (native) -> prores (prores_ks))
Press [q] to stop, [?] for help
No more output streams to write to, finishing.e=00:01:04.28
bitrate=115202.2kbits/s speed=0.42x
frame= 1612 fps= 11 q=-0.0 Lsize=  904052kB time=00:01:04.44
bitrate=114928.4kbits/s speed=0.42x
video:904040kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.001372%
Input file #0 (INPUT.dpx):
  Input stream #0:0 (video): 1612 packets read (13390381056 bytes); 1612
frames decoded;
  Total: 1612 packets (13390381056 bytes) demuxed
Output file #0 (OUTPUT.mov):
  Output stream #0:0 (video): 1612 frames encoded; 1612 packets muxed
(925736976 bytes);
  Total: 1612 packets (925736976 bytes) muxed




I checked my input footage with ffprobe and mediainfo and the output is as
follows:

--> ffprobe
Input #0, dpx_pipe, from 'INPUT':
  Duration: N/A, bitrate: N/A
Stream #0:0: Video: dpx, gbrp10le, 1920x1080 [SAR 1:1 DAR 16:9], 25
tbr, 25 tbn, 25 tbc

--> mediainfo
Format   : DPX
Format version: Version 1.0
File size : 12.5 GiB
Duration  : 1 min 4 s
Overall bit rate : 1 661 Mb/s
Encoded date  : 2016-10-05T10:36:57Mit
Writing library  : daVinci

Video
Format   : DPX
Format version   : Version 1.0
Duration : 1 min 4 s
Bit rate : 1 661 Mb/s
Width: 1 920 pixels
Height   : 1 080 pixels
Display aspect ratio : 16:9
Frame rate   : 25.000 FPS
Color space  : RGB
Bit depth: 10 bits
Scan type: Progressive
Compression mode : Lossless
Bits/(Pixel*Frame)   : 32.047
Stream size  : 12.5 GiB (100%)
Writing library  : daVinci
Encoded date : 2016-10-05T10:36:57Mit
Color primaries  : Printing density



The output file has the following info:

-->ffprobe
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'OUTPUT.mov':
  Metadata:
major_brand : qt
minor_version   : 512
compatible_brands: qt
encoder : Lavf57.51.103
  Duration: 00:01:04.48, start: 0.00, bitrate: 114857 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le,
1920x1080, 114855 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn, 12800
tbc (default)
Metadata:
  handler_name: DataHandler
  encoder : Lavc57.61.102 prores_ks





2016-10-13 15:05 GMT+02:00 Andy Furniss :

> Kevin Wheatley wrote:
>
>> Andreas,
>>
>> instead of using the -colormatrix option try instead using
>>
>> -vf scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_c
>> olor_matrix=bt709
>>
>> assuming your DPX files are utilising full range encoding
>>
>
> also scale has flags which may or may not affect quality in this case.
>
> IIRC getting them to work can be a bit var

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-13 Thread Andy Furniss

Kevin Wheatley wrote:

Andreas,

instead of using the -colormatrix option try instead using

-vf 
scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709

assuming your DPX files are utilising full range encoding


also scale has flags which may or may not affect quality in this case.

IIRC getting them to work can be a bit variable, historically

-sws-flags flag1+flag2 ... used to work, but not last time I tested so

-vf scale=:flags=flag1+flag2. was what I last used - best

to double check with -loglevel verbose + check output to be sure.

https://www.ffmpeg.org/ffmpeg-scaler.html#scaler_005foptions

I am thinking of trying accurate_rnd full_chroma_int full_chroma_inp 
bitexact


not that I know what's best or relevant, so trial and error really.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-13 Thread Kevin Wheatley
Andreas,

instead of using the -colormatrix option try instead using

-vf 
scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709

assuming your DPX files are utilising full range encoding


Kevin
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-12 Thread Andreas Hummel
Thanks for your response Carl Eugen,.

Up until now i only had to deal with image sequences and didn't
convert them myself. Therefore i wasn't sure if the results could
have been better with other options. Thanks for your feedback.

cheers,
Andreas




2016-10-12 11:58 GMT+02:00 Carl Eugen Hoyos :

> 2016-10-12 11:41 GMT+02:00 Andreas Hummel :
>
> > Here you may find a comparison image:
> > http://www.directupload.net/file/d/4506/satnse88_jpg.htm
> >
> > Full resolution can be found here:
> > http://uploaded.net/file/e02zd4ct
>
> (I have probably downloaded thousands of user-provided samples,
> these sites are not acceptable, sorry. Our own upload site is
> unfortunately down for months already.)
>
> > Or is that already the 'best' output i can get?
>
> I cannot really comment on your issue but your input file has 30bpp,
> your h264 output file only 12, so there has to be a difference wrt the
> colour representation.
>
> Carl Eugen
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-12 Thread Carl Eugen Hoyos
2016-10-12 11:41 GMT+02:00 Andreas Hummel :

> Here you may find a comparison image:
> http://www.directupload.net/file/d/4506/satnse88_jpg.htm
>
> Full resolution can be found here:
> http://uploaded.net/file/e02zd4ct

(I have probably downloaded thousands of user-provided samples,
these sites are not acceptable, sorry. Our own upload site is
unfortunately down for months already.)

> Or is that already the 'best' output i can get?

I cannot really comment on your issue but your input file has 30bpp,
your h264 output file only 12, so there has to be a difference wrt the
colour representation.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] dpx to prores & h.264 - color shift

2016-10-12 Thread Andreas Hummel
Hi there,

i'm struggeling with the conversion from dpx files via ffmpeg to prores and
h.264 movie files on a windows machine. In the past days i read a lot about
the different flags and options but couldnt figure out what the 'best'
conversion technique is.
At the moment i'm getting a slight hue shift in the encoded videos and i
don't know where it's coming from. Probably i'm using too many options or
false flags but i thought, this list might give me a hint to solve the
problem at it's core.

Somehow i always get the color shift, regardless which options i try with
ffmpeg on the command line. The only way to obtain a 1:1 color
representation in a prores file was via Nuke from TheFoundry.

For h.264 i've got almost the same issue plus settle banding artefacts in
dark areas with a gradient. I tried to minimize the artefacts in the
gradient but couldn't find a suitable option yet.

Here you may find a comparison image:
http://www.directupload.net/file/d/4506/satnse88_jpg.htm

Full resolution can be found here:
http://uploaded.net/file/e02zd4ct

Zoom is at 100%. The left image shows a frame from the dpx sequence, 2nd is
the ffmpeg prores and 3rd picture shows a crop of my best attempt to encode
it with h264.

Or is that already the 'best' output i can get?

Thanks in advance for your help.

Cheers,
Andreas



My code looks like this:

###
PRORES:
ffmpeg.exe -y -f image2 -start_number 0 -r 25 -i INPUT_%8d.dpx -r 25
-vcodec prores_ks -profile:v 3 -pix_fmt yuv422p10le -filter_complex
"[0:v]lutrgb=r=gammaval(1/1.0):g=gammaval(1/1.0):b=gammaval(1/1.0),colormatrix=bt601:
bt709'" -color_primaries bt709 -color_trc bt709 -colorspace bt709 -vendor
ap10 OUTPUT_prores3.mov


ffmpeg\x64\be1d324\bin\ffmpeg.exe -y -f image2 -start_number 0 -r 25 -i
INPUT_%8d.dpx -r 25 -vcodec prores_ks -profile:v 3 -pix_fmt yuv422p10le
-filter_complex
"[0:v]lutrgb=r=gammaval(1/1.0):g=gammaval(1/1.0):b=gammaval(1/1.0),colormatrix=bt601:
bt709'" -color_primaries bt709 -color_trc bt709 -colorspace bt709 -vendor
ap10 OUTPUT_prores3.mov
ffmpeg version N-81872-gbe1d324 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth
--enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264
--enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libsnappy --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg
--enable-lzma --enable-decklink --enable-zlib
  libavutil  55. 32.100 / 55. 32.100
  libavcodec 57. 60.101 / 57. 60.101
  libavformat57. 51.102 / 57. 51.102
  libavdevice57.  0.102 / 57.  0.102
  libavfilter 6. 63.100 /  6. 63.100
  libswscale  4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc54.  0.100 / 54.  0.100
Input #0, image2, from 'INPUT_%8d.dpx':
  Duration: 00:01:04.48, start: 0.00, bitrate: N/A
Stream #0:0: Video: dpx, gbrp10le, 1920x1080 [SAR 1:1 DAR 16:9], 25
tbr, 25 tbn, 25 tbc
Output #0, mov, to 'OUTPUT.mov':
  Metadata:
encoder : Lavf57.51.102
Stream #0:0: Video: prores (prores_ks) (apch / 0x68637061),
yuv422p10le(bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps,
12800 tbn, 25 tbc
Metadata:
  encoder : Lavc57.60.101 prores_ks
Stream mapping:
  Stream #0:0 (dpx) -> lutrgb
  colormatrix -> Stream #0:0 (prores_ks)
Press [q] to stop, [?] for help
frame= 1612 fps=9.0 q=-0.0 Lsize= 1173941kB time=00:01:04.44
bitrate=149238.3kbits/s speed=0.358x
video:1173928kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.001109%

###
h.264:
ffmpeg.exe -y -probesize 500 -f image2 -start_number 0 -r 25 -i
INPUT_%8d.dpx -r 25 -vcodec libx264 -preset superfast -profile:v high
-level 4.2 -crf 9 -pix_fmt yuv420p -vf colormatrix=bt601:bt709
-color_primaries 1 -color_trc 1 -colorspace 1 -vendor ap10 OUTPUT.mov


ffmpeg\x64\be1d324\bin\ffmpeg.exe -y -probesize 500 -f image2
-start_number 0 -r 25 -i INPUT_%8d.dpx -r 25 -vcodec libx264 -preset
superfast -profile:v high -level 4.2 -crf 9 -pix_fmt yuv420p -vf
colormatrix=bt601:bt709 -color_primaries 1 -color_trc 1 -colorspace 1
-vendor ap10 OUTPUT.mov
ffmpeg version N-81872-gbe1d324 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--