[FFmpeg-user] how to specify pixel format of input image pixels

Mayur Patel m.patel at toonboxent.com
Fri Sep 14 22:03:28 EEST 2018


Thanks for your reply.

Here is the full output from the ffmpeg invocation:

> m.patel at dk131 ~]$ffmpeg -r 24 -f image2  -c:v tiff -pix_fmt yuv444p -start_number 0101 -y -i "/home/personal_folders/m.patel/share/mastering/fng_test/src/030/010_0030_frames_l_65c0f650a16b11e88c2790b11c92e13d.%04d.exr.tif" -r 24 -vframes 130 -threads 6 -c:v dnxhd -timecode 00:00:04:05 -vf format=yuv422p,scale=out_range=tv -b:v 36M /var/tmp/a_dnxhd.mov
ffmpeg version 4.0.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, image2, from '/home/personal_folders/m.patel/share/mastering/fng_test/src/030/010_0030_frames_l_65c0f650a16b11e88c2790b11c92e13d.%04d.exr.tif':
  Duration: 00:00:05.42, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: tiff, rgb24, 1920x1080, 24 fps, 24 tbr, 24 tbn, 24 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (tiff (native) -> dnxhd (native))
Press [q] to stop, [?] for help
Output #0, mov, to '/var/tmp/a_dnxhd.mov':
  Metadata:
    timecode        : 00:00:04:05
    encoder         : Lavf58.12.100
    Stream #0:0: Video: dnxhd (DNXHD) (AVdn / 0x6E645641), yuv422p, 1920x1080, q=2-1024, 36000 kb/s, 0.04 fps, 12288 tbn, 24 tbc
    Metadata:
      encoder         : Lavc58.18.100 dnxhd
frame=  130 fps=103 q=1.0 Lsize=   23922kB time=00:00:05.37 bitrate=36458.1kbits/s speed=4.27x    
video:23920kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.006557%


Perhaps there's something that needs to happen in the TIF header?

My TIF header looks like this:
TIFF Directory at offset 0x8 (8)
  Image Width: 1920 Image Length: 1080
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: RGB color
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 32
  Planar Configuration: single image plane
  Software: OpenImageIO 1.8.5 : oiiotool -q --threads 3 -i /home/personal_folders/m.patel/share/mastering/fng_test/src/030/010_0030_frames_l_65c0f650a16b11e88c2790b11c92e13d.0110.exr --iscolorspace acescg --tocolorspace yuv --fit 1920x1080 --croptofull --dither --scanline -d uint8 -o /home/personal_folders/m.patel/share/mastering/fng_test/src/030/010_0030_frames_l_65c0f650a16b11e88c2790b11c92e13d.0110.exr.tif
  DateTime: 2018:09:14 10:50:25
  RichTIFFIPTC Data: <present>, 420 bytes
  Predictor: horizontal differencing 2 (0x2)


Do I need to figure out how to set my TIF header Photometric Interpretation to 6 (YCrCb)?  Does ffmpeg key from that?

Mayur


________________________________________
From: ffmpeg-user [ffmpeg-user-bounces at ffmpeg.org] on behalf of Kieran O Leary [kieran.o.leary at gmail.com]
Sent: Friday, September 14, 2018 2:13 PM
To: FFmpeg user questions
Subject: Re: [FFmpeg-user] how to specify pixel format of input image pixels

Hi

On Fri, 14 Sep 2018, 16:33 Mayur Patel, <m.patel at toonboxent.com> wrote:

> We have encoded YUV pixels into TIF images.  TIF is one of the few image
> formats that FFMPEG show support for yuv444p pixels (as identified by
> ffmpeg -h encoder=tiff)
>
> I am having trouble getting ffmpeg to read the pixels as yuv444p (as
> opposed to the default rgb24):
>
>
> Here is a typical command line:
>
> ffmpeg -r 24 -f image2  -c:v tiff -pix_fmt yuv444p -start_number 0101 -y
> -i "frames.%04d.tif" -r 24 -vframes 130 -threads 6 -c:v dnxhd -timecode
> 00:00:04:05 -vf format=yuv422p,scale=out_range=tv -b:v 36M
> /var/tmp/a_dnxhd.mov
>

Can you send the full, uncut terminal output? Are you sure that your input
TIFF files are actually YUV and not RGB? Also perhaps share one of the tiff
files? I  tried with an oldish version of ffmpeg which had no issue
identifying yuv444p TIFF:

$ ffmpeg -i  1fr.tif
ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse
--enable-librubberband --enable-librsvg --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx
--enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394
--enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r
--enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, tiff_pipe, from '1fr.tif':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: tiff, yuv444p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr,
25 tbn, 25 tbc


Best,

Kieran.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


More information about the ffmpeg-user mailing list