lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Scan-Type (progressive/interleaved) detection with mediainfo #318

Closed ProxyCell closed 4 years ago

ProxyCell commented 4 years ago

Feature request/enhancement

I often get a lot of transport streams from TV show recordings here in Japanland and because they adopted HD standards super-early they ended up using interlaced/interleaved video broadcasts and still do to this day!

This was less of an issue back in the good old days where men were men, cars were horses and CRT scanlines would hide a great deal of the interlacing "combing" effects. But I'm living in 2020 Japan now and while interlacing is still a thing here along with fax machines and kerosene-heaters, I'd like us all to move into the "future" that is May 23, 2020, a future where videos are deinterlaced only when they should be!

@donmelton You know I love you and the video_transcoding (seriously, thanks man, iCal is pretty boss too, yo)

Occasionally though, it will decide to deinterlace a progressively-scanned video or and occasionally the opposite: not automatically deinterlacing interlaced videos.

I'm using the terminal version of mediainfo v20.03 - This was installed by HomeBrew on macOS Catalina 10.15.4 (19E287)

You can dump a ton of useful info with just: mediainfo ./my_cool_new_video.mkv

The following command will list all of the parameters you can specify it to provide you with. mediainfo --Info-Parameters

This is how it looks when you give it an interlaced video and request the status of it's "ScanType" mediainfo --Inform="Video;%ScanType/String%" ./my_cool_new_video.mkv Interlaced

This is how it looks when you ask it for the same, but giving it a progressively scanned video: mediainfo --Inform="Video;%ScanType/String%" ./my_cool_new_video.MP4 Progressive

It returns a one-word answer that should be easy to implement into the deinterlacing-logic of transcode-video.

lisamelton commented 4 years ago

@ProxyCell I agree that transcode-video needs better detection of progressive vs. interlaced inputs. However, I don't want to add yet another dependency, i.e. mediainfo, to the project. It's already too hard to install all the various dependencies for some people. So I'm at the mercy of the detection code in HandBrakeCLI for this.

I may be able to improve how I use of HandBrakeCLI though, so I will look into that.

In the meantime, have you tried any of these problem videos with other-transcode from my Other Video Transcoding project here?

https://github.com/donmelton/other_video_transcoding

The other-transcode tool leverages ffprobe so it can really tell the difference between progressive vs. interlaced. So its automatic behavior is a little more sensible.

ProxyCell commented 4 years ago

Thanks a lot @donmelton ! I actually didn't know about the "other" repo, I'll check it out soon and have my machines begin transcoding with it to test it out.

It's not a big deal, the current gem state already does more than what I could ever hope for on my own. Thanks man!