digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Encode, Convert for discs (https://www.digitalfaq.com/forum/video-conversion/)
-   -   Do you lose quality when encode interlaced content as progressive? (https://www.digitalfaq.com/forum/video-conversion/10481-lose-quality-encode.html)

Nik92 04-01-2020 03:35 AM

Do you lose quality when encode interlaced content as progressive?
 
Hi All,

I'm capturing VHS via VirtualDub as uncompressed UYVY.
I want to encode it with FFV1 as final result for storage.
Here’s the part I don’t fully understand.
Captured file, UYVY, doesn’t have any flags whether it’s interlaced or progressive.
In fact, according to this page, UYVY is always progressive:
https://www.loc.gov/preservation/dig...dd000365.shtml
FFV1 encodes it as progressive as well and now if I check media info, it’s progressive.
In any case, for both UYVY and FFV1 the content is kept as interlaced:
Code:

ffmpeg -filter:v idet -frames:v 100 -an -f rawvideo -y NUL -i D:\VD\VHS_full_FFV1_pass1.mkv
Code:

[Parsed_idet_0 @ 000001bbf074e480] Repeated Fields: Neither:  101 Top:    0 Bottom:    0
[Parsed_idet_0 @ 000001bbf074e480] Single frame detection: TFF:  101 BFF:    0 Progressive:    0 Undetermined:    0
[Parsed_idet_0 @ 000001bbf074e480] Multi frame detection: TFF:  101 BFF:    0 Progressive:    0 Undetermined:    0

My question is, do I lose any quality by encoding interlaced content as progressive?
Will there be any problem to deinterlace such encoded video in the future?

Thanks in advance!

hodgey 04-01-2020 10:28 AM

It won't have any quality loss provided there is no chroma subsampling in the vertical direction (i.e 4:2:0), since fields are weaved together on alternating lines. Lossy compression will also cause issues if you encode interlaced as progressive.

FFV1 doesn't have any interlacing flag, but since it's lossless it's fine as long as it's kept as 4:2:2 (which it should be unless you intentionally change it.)

You do however have to take into account that any application opening the file will not know that it is interlaced footage, and what field order it is. It would be great if the lossless codecs usable for capture had full support for flagging interlaced/progressive and field order, but I don't know any that do. Huffyuv and utvideo can mark a video as interlaced, but has no field order flag (and for whatever reason ffmpeg and other apps like to assume bottom field first). lossless H.264 (and possibly H.265) does support both interlaced encoding and a field order flag, but it's extremely slow to encode and decode, so it's not all that practical for capture and editing.

Nik92 04-01-2020 03:15 PM

Thanks a lot hodgey.
Since the goal of encoding it with FFV1 for me was to store and use as source file later, I don't care that much if it will be incoreclty recognised by apps (that's probably video players in general).

Anyway, I tried to capture with huffyuy and encode it with FFV1 and I was able to make FFV1 video interlaced with some tricky solution I found:
Code:

ffmpeg -i D:/VD/VHS_HUFF.avi -top 1 -f yuv4mpegpipe - | ffmpeg -i - -i D:/VD/VHS_HUFF.avi -map 0:0 -map 1:1 -c:v ffv1 -threads 12 -g 1 -slices 4 -slicecrc 1 D:/VD/VHS_HUFF_FFV1_pipe_simple.mkv
Code:

Video
ID                          : 1
Format                      : FFV1
Format version              : Version 3.4
Format settings, GOP        : N=1
Codec ID                    : V_MS/VFW/FOURCC / FFV1
Duration                    : 1 min 32 s
Bit rate mode              : Variable
Bit rate                    : 82.2 Mb/s
Width                      : 720 pixels
Height                      : 576 pixels
Display aspect ratio        : 5:4
Frame rate mode            : Constant
Frame rate                  : 25.000 FPS
Standard                    : PAL
Color space                : YUV
Chroma subsampling          : 4:2:2
Bit depth                  : 8 bits
Scan type                  : Interlaced
Scan type, store method    : Interleaved fields
Scan order                  : Top Field First
Compression mode            : Lossless
Bits/(Pixel*Frame)          : 7.931
Stream size                : 909 MiB (98%)
Writing library            : Lavc58.75.100 ffv1
Default                    : Yes
Forced                      : No
coder_type                  : Golomb Rice
MaxSlicesCount              : 4
ErrorDetectionType          : Per slice

Now it looks like I have a better option although I might even stick to UYVY as I wanted to edit a bit source file in Adobe Premiere before encoding it with FFV1.
And unfortunately Adobe Premiere can't export into Huffyuv (only found UYVY).

Thanks

msgohan 04-04-2020 06:49 AM

Quote:

Originally Posted by hodgey (Post 67674)
It would be great if the lossless codecs usable for capture had full support for flagging interlaced/progressive and field order, but I don't know any that do.

For what it's worth, I noticed that my Canopus NHX-E2 captures produced by their Edius software have the full complement: interlaced flag, TFF field order, and aspect ratio*. Compression ratio is excellent, and it's fast enough for capture on an old machine.

But if I try using VirtualDub to compress with this Canopus/Grass Valley Lossless Codec, the Configure button is greyed out. The resulting file plays 4:3 in MPC-HC but not VLC, and no deinterlacing is done by either player.

* It's 720x486 with DAR 4:3 -- slightly incorrect, but close enough for casual viewing. Should be 1.347:1 not 1.333:1 if my math is right.


All times are GMT -5. The time now is 04:48 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.