FFMpeg: PNG/TIFF image sequence to lossless video for using in VP13+

fifonik wrote on 2/1/2019, 4:12 PM

My 8mm films were scanned as PNG/TIFF image sequences.

I'd like to convert them into lossless videos that would be edited in VP13+ (I'm using 15 right now, sometimes falling back to VP13). These files will only be used temporary while editing.

In VirtualDub I can convert them to avi using HuffYUV, Lagarith, MagicYUV or Cineform (visually lossless). They works fine in VP.

However, I'd prefer to do this using FFMpeg CLI and only found FFV1 and x264 lossless options available.

Unfortunately, FFV1 is not opened in VP (I can play it using my video player with no issues) and x264 lossless is very laggy when edited in Vegas.

 

So my questions:

- What decoder can I install to open FFV1 in VP? (Single decoder only, I'm not going to install any codec packs)

- Are there any options that may increase frame seek/access time for x264 lossless?

- Are there any other lossless or visually lossless options available in FFMpeg CLI?

 

Thanks.

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

Comments

john_dennis wrote on 2/1/2019, 6:03 PM

“However, I'd prefer to do this using FFMpeg CLI...”

Why? You can open a Still Image Sequence directly in Vegas and save to lossless Magic YUV RGB.

wwaag wrote on 2/1/2019, 7:13 PM

@fifonik

The latest version of ImportAssist in HOS (1.0.2.51) now supports direct import of images and lossless encoding direct to UtVideo.

In the next version, I'll add an option for encoding to MagicYUV as well. I've been doing some film restoration stuff with OldSmoke using VideoFred's and John Meyer's scripts and will probably include this within HOS in the next version if anyone is interested.

fifonik wrote on 2/1/2019, 7:38 PM
Why? You can open a Still Image Sequence directly in Vegas and save to lossless Magic YUV RGB.

- Smaller. PNGs -- 35GB (TIFFs even bigger), MagicYUV RGB or x264 lossless - 14.5 GB.

- Faster. Vegas on my system cannot play PNGs in realtime, no such issue with the mentioned lossless. Probably HDD is the bottleneck.

- Easier to manage. I do not like to have many files in one folder.

- As a programmer I prefer CLI over GUI if possible. Also, if this can be done with FFMpeg it would be portable solution (no any encoders installation required).

 

The latest version of ImportAssist in HOS (1.0.2.51) now supports direct import of images and lossless encoding direct to UtVideo.

I'd prefer MagicYUV over UtVideo. If I want to use UtVideo, I can also do it in VDub (GUI).

Anyway, HO is GUI, not CLI. I already have simple, stable and fast VDub solution.

Last changed by fifonik on 2/1/2019, 8:12 PM, changed a total of 1 times.

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

wwaag wrote on 2/1/2019, 7:52 PM

@fifonik

It's a very simple CL. Here's the one I use for utVideo.

ffmpeg -framerate 16 -f image2 -y -i "H:\OldSmoke\image_%6d.png" -codec utvideo "H:\HOtempRender\hoTemp.avi"

For magicYUV, change "utvideo" to "magicyuv".

That's it. I'm using the Zeranoe 4.1 build.

One caveat. I don't know if it will work without the UtVideo and MagicYUV codecs being installed. Try it and let us know.

 

fifonik wrote on 2/1/2019, 8:00 PM

Found one solution (FFMpeg manual is a mess): -vcodec huffyuv. I though FFMpeg only support its own HyffYUV implementation and VP cannot open it. However, original huffyuv is also natively supported.

Still digging for other options :)

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

fifonik wrote on 2/1/2019, 8:04 PM

@fifonik

ffmpeg -framerate 16 -f image2 -y -i "H:\OldSmoke\image_%6d.png" -codec utvideo "H:\HOtempRender\hoTemp.avi"

For magicYUV, change "utvideo" to "magicyuv".

Thanks!

I did not know that I can use other codecs like this. Will use "-codec magicyuv" or "-codec huffyuv"

P.S. I do not have UtVideo encoder installed but encoding with "-codec utvideo" works just fine. Wow! Sure it cannot be opened in VP until I install the decoder.

Last changed by fifonik on 2/1/2019, 9:05 PM, changed a total of 3 times.

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

wwaag wrote on 2/1/2019, 8:19 PM

You could also use the Apple Animation codec "qtrle", but it really produces very large files. I'd stick with Magic since it decodes so well in Vegas.

Musicvid wrote on 2/1/2019, 10:02 PM

I'd prefer MagicYUV over UtVideo.

Why? They are statistically the same.

Musicvid wrote on 2/1/2019, 10:05 PM

Apple RLE was not included in the above tests because it showed rounding errors on the scopes indicative of light banding.

fifonik wrote on 2/1/2019, 11:50 PM

> Why? They are statistically the same.

Yup. File size only slightly bigger for MagicYUV.

However, I already have MagicYUV installed and it is faster (here I'm talking about decoding speed, so more CPU will be available for other stuff like filters).

 

Played with ffmpeg options and found that:

- Option "-pred gradient" should be used for MagicYUV as default is "-pred left" that gives 25% bigger file size

- This is also true for huffyuv encoder. Unfortunately, on my system I have glitches in Vegas if the -pred option is anything but "left".


 

@ECHO off
SET ff="C:\Program Files\FFMpeg\bin\ffmpeg.exe"
SET src=-f image2 -framerate 18 -start_number 1 -i prefix_%%05d.png

%ff% %src% -codec huffyuv  -pred left      FF_HuffYUV_left.avi
%ff% %src% -codec huffyuv  -pred median    FF_HuffYUV_median.avi

%ff% %src% -codec utvideo  -pred left      FF_UtVideo_left.avi
%ff% %src% -codec utvideo  -pred median    FF_UtVideo_median.avi

%ff% %src% -codec magicyuv -pred left      FF_MagicYUV_left.avi
%ff% %src% -codec magicyuv -pred median    FF_MagicYUV_median.avi
%ff% %src% -codec magicyuv -pred gradient  FF_MagicYUV_gradient.avi

 

Last changed by fifonik on 2/2/2019, 12:17 AM, changed a total of 2 times.

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

Musicvid wrote on 2/1/2019, 11:55 PM

However, I already have MagicYUV installed and it is faster (here I'm talking about decoding speed, so more CPU will be available for other stuff like filters).

Oh, I didn't know that.

fifonik wrote on 2/2/2019, 12:09 AM

Well, I have not compared speed by myself. It is MagicYUV's developer claim.

Howerer, he did the comparison with UtVideo 17.1 and there are quite alot of "speed improvements" in UtVideo change log since then so it might be not true already.

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

Former user wrote on 2/2/2019, 12:33 AM

Try this lossless codec. You will be amazed at the result.

https://www.videohelp.com/software/Grass-Valley-HQX-Codec/old-versions

john_dennis wrote on 2/2/2019, 2:42 AM

I'm still struggling with why you feel the need to use a CLI to convert a still image sequence to a Magic YUV RGB video file for future editing. Of course, other than the fact that you're a programmer and you have your preferences. I'll stipulate to that and leave you alone after this post.

I encoded a Magic YUV RGB avi file from a still image sequence in Vegas 14 using the options presented in Vegas.

Comparing the result using Wayne's Quality Measurement tool, I got these results:

Date: 2019/02/02  00:03:42 
Description: Magic YUV RGB from Still Image Sequence in Vegas 14
Frames Processed: 914
Processing Speed: 1.20 fps
Mean Squared Error: 0
Peak Signal to Noise Ratio: 99

"Unfortunately, on my system I have glitches in Vegas if the -pred option is anything but "left"."

When I put the file back on a Vegas 13 timeline for editing, I don't experience glitches or I don't know what to look for.

All that said, even I am doing way more scripting than I ever thought I would.

fifonik wrote on 2/2/2019, 3:04 AM
Of course, other than the fact that you're a programmer and you have your preferences

For me it is faster and more reliable to key in command (in fact mopy and slightly modify), double check it an run, than click mayy times in a number different places and do not forgot to set some important option.

Another reason: ffmpeg is "everything in one box tool". I'm going to send a bunch of 8mm films for scanning and can provide very simple script that will do the lossless compression job. As a result, it would be huge time saving on 2 data copy processes. And I will still have mathematically lossless results.

When I put the file back on a Vegas 13 timeline for editing, I don't experience glitches or I don't know what to look for.

Are you still talking about MagicYUV or HuffYUV? I do not have any issues with MagicYUV, it was about HuffYUV (ffmpeg's implementation, I do not have such issue in standalone encoder that I can use in Virtual Dub or Vegas).

Camcorder: Panasonic X920

Desktop: MB: MSI B450M MORTAR TITANIUM, CPU: AMD Ryzen 3700X (not OC), RAM: G'Skill 16 GB DDR4@3200 (not OC), Graphics card: MSI RX580 8GB (factory OC), SSD: Samsung 970 Evo+ NVMe 500MB (OS), HDDs: Seagate & Toshiba 2TB, OS: Windows 10 Pro 1909

NLE: Vegas Pro [Edit] 11, 12, 13, 15, 17

Musicvid wrote on 2/2/2019, 7:46 AM

Huffy was compared here.

https://www.vegascreativesoftware.info/us/forum/seven-mathematically-lossless-codecs-legacy-article--112259/

Musicvid wrote on 2/2/2019, 7:54 AM

I'm still struggling with why you feel the need to use a CLI to convert a still image sequence to a Magic YUV RGB video file for future editing. Of course, other than the fact that you're a programmer and you have your preferences. I'll stipulate to that and leave you alone after this post.

+1

Except that wwaag has got me interested again in custom command lines.