0

I have a folder of .tifs that are really noisy images (digital images from a microscope). They are also quite small in dimmension, like 260x260 pixels.

I want to turn them into a playable movie that works across windows and macs.

I tried libx264, but I get this horrible patchwork of squares pattern across the image.

I tried a lot of options with libx264, like -crf 24, -crf 0 (supposedly lossless, its not). I've tried different -pix_fmts.

In general my commands looked like

ffmpeg -framerate 33 -i Out01x\Singles_%04d.tif -c:v libx264 -crf 0 -pix_fmt yuv420p test2.avi

So then I tried a lossless format, huffyuv

ffmpeg.exe -framerate 33 -i Out01x\Singles_%04d.tif -c:v huffyuv Out01x.avi

This initially looked ok. But then I found it doesn't support .mov or quicktime. Which isn't going to work, because my colleagues will need .mov support.

I then tried just a straight .png lossless format.

ffmpeg -framerate 33 -i Out01x\Singles_%04d.tif -c:v png test.mov

This looks okay also, and appears to play in quicktime (although I'm still waiting for someone with a mac to confirm).

Is .png really my best option here? It seems not very 'standard'. But I'm not a video professional, so maybe it is considered a good option.

It doesn't work in windows media player. But none of these do, so I blame WMP more than the codec issues. They all work in vlc, quicktime (on windows) and other windows players.

Is there a better way to do this?

Edit:

Here is a screenshot of the patchwork I'm seeing. With lines I drew to highlight a portion of it.

patchwork example

Nertskull
  • 151
  • 4
  • Couple of answers here: https://superuser.com/questions/486325/lossless-universal-video-format one suggesting a modification to one of your commands, another suggesting vp9 (webm) having a lossless mode... – Mokubai Feb 12 '18 at 12:41
  • @Mokubai Yes, I've seen that answer and tried all those commands. Still same result with the patchwork, even when using -crf 0. I also had tried the vp9 suggestion. And 1. its not supported in .mov, and 2, even in .avi format it was crashing vlc on my windows 10 using their suggested command. – Nertskull Feb 12 '18 at 12:48
  • @Nertskull For source-matching, you want `ffmpeg -framerate 33 -i Out01x\Singles_%04d.tif -c:v libx264 -crf 0 test2.mov` - for playback, you will want VLC. The pix_fmt is subsampling the chroma data before it is sent to the encoder, so you lose information there, not due to the encoder. – Gyan Feb 12 '18 at 13:32
  • Some players downsample video to 4:2:0 before rendering, so it can give a misleading impression about the fidelity of the converted file. See https://video.stackexchange.com/q/16674/1871 – Gyan Feb 12 '18 at 13:34
  • @Mulvya I tried your command, exactly. And played back in VLC. And it still shows the patchwork pattern. – Nertskull Feb 12 '18 at 16:12
  • @Mulvya I guess it could be player specific. I definitely get lines in VLC still. And on quicktime, it won't even play using crf 0 (quicktime on windows at least) – Nertskull Feb 12 '18 at 16:16
  • Can you share the file? – Gyan Feb 12 '18 at 16:32
  • @Mulvya Here is a link to dropbox zip with the individual frames. https://www.dropbox.com/s/fjlzqhbfxfpxcn7/Test.zip?dl=0 – Nertskull Feb 12 '18 at 16:56
  • Running `ffmpeg -framerate 33 -i Singles_%04d.tif -i test2.mov -lavfi ssim;[1][0]psnr -f null -`, I get `[Parsed_ssim_0 @ 00000000005cfc40] SSIM Y:1.000000 (inf) All:1.000000 (inf) [Parsed_psnr_1 @ 0000000003e32bc0] PSNR y:inf u:inf v:inf average:inf min:inf max:inf` i.e. perfect fidelity. I used my command to generate the MOV. – Gyan Feb 12 '18 at 17:08
  • @Mulvya Hmm, and you don't see any of the patchwork in the video, like I show in the attached image above? Because I copied and pasted your command exactly, and still get those artifacts. Here is the movie itself, make it full screen and it looks horrible (in VLC). https://www.dropbox.com/s/qpq3p0hou8tj0pe/test4.zip?dl=0 – Nertskull Feb 12 '18 at 17:19
  • Your file is 4 times larger than my output and has a SSIM score of 0.287425 !! which is very low. Run the command again with `-report` added and share the report. – Gyan Feb 12 '18 at 18:01
  • @Mulvya That's probably because I only shared 50 frames with you, but my file was from the entire ~213 or so frames. – Nertskull Feb 12 '18 at 18:02

0 Answers0