Background
I am trying to convert a tiff image to an h.264 encoded frame. I am using FFMPEG to do so. With a PNG, I can convert using the following command
./ffmpeg -loglevel error -hide_banner -i /path/to/input.png -c:v libx264 -pix_fmt yuv420p10le /path/to/outputFrame.h264
This works great and gives me a proper frame. The PNG is 16 bit greyscale.
I tried the following with a 14bit greyscale tif as an input
./ffmpeg -loglevel error -hide_banner -i /path/to/input.tiff -c:v libx264 -pix_fmt yuv420p10le /path/to/outputFrame.h264
and got an error:
This format is not supported (bpp=14, bppcount=1)
I had read elsewhere that
FFmpeg does support upto 16 bpc RGB TIFFs or 8 bit YUV TIFFs or 16 bit grayscale ones..
So used imagemagick identify function to verify my tif it stated that it was indeed a 14 bit grayscale gray image.
So I tried a 10bit version, this gave me same error above except it was now bpp=10 instead of bpp=14.
I then figured the pix-fmt was off, so I tried gray10le with the 10bit image with no luck. Same error.
I want to have the full bit depth of the image anyways, so would prefer a 16 or 14 bit solution.
My Question
How can I take a 14 bit TIF and convert it to a h264 encoded frame using ffmpeg or Imagemagick maintaining the highest bit depth that h264 will allow? I also would prefer not to convert to an intermediary format. I am running on CentOS Linux
Update
When I force the depth down to 8 with the TIF and send it into the above ffmpeg command, it does go through but when I go to open the frame in VLC, it does not come up like it does when I do the same thing with a 16 bit greyscale PNG...
Update 2 Per a comment, I tried forcing the tif to 16 bit grayscale and that worked with the original pixel formats I had in the PNG-centered ffmpeg command.
I am still having a hard time displaying the frame in VLC, but it could be due to the size of the image. It is quite large. I will try tiling it to make sure the data is intact. If its not intact, the question still stands. If its intact I will just "answer my own question"