View Full Version : How to serve H.264/4:2:2 video when use of DGDecodeNV not possible
MrVideo
7th July 2017, 05:57
The reason that I cannot use DGDecodeNV to serve the video to x264 is that my nVidia card does not support H.264/4:2:2 video (4:2:0 only).
Is there something else I can use to do the serving?
Here is an example with one of my AVS templates:
LoadPlugin("C:\Program Files (x86)\DGAVCDecNV\DGDecodeNV.dll")
dgsource("=DRIVE=\=FILENAME=")
assumetff()
telecide(guide=1)
decimate()
Yes, it is to IVTC the 1080i29.97 to 1080p23.976.
Any and all tips appreciated.
sneaker_ger
7th July 2017, 07:26
ffms2?
MrVideo
7th July 2017, 08:34
Going this web page (https://github.com/FFMS/ffms2) I find the following line:
This plugin is a part of the FFMS2 project and is available for download here;
Except there is no link. I think it is obtained from here: https://github.com/FFMS/ffms2/releases
If that is the case, then I think the file is: ffms2-2.23.1-msvc.7z
I have no idea where to drop the contents of the directory contained therein.
In the user manual (https://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md) I find the following line:
Because of LAVF's demuxer, most raw streams (such as elementary h264 and other mpeg video streams)
will fail to work properly.
I do most of my work as H.264 elementary streams. But, if I have to feed it the TS file and ignoring the audio, so be it.
Once I have the plugin, the user manual gives no example as how to incorporate it into an AVS script, like the one I have above. That said, I am assuming that I would use FFVideoSource, as I will be ignoring the audio (that is handled differently).
Still playing with the info, but still confused.
UPDATE: D'Oh! Looks like the ftms2.dll is dropped into the AVSynth plugins directory.
Groucho2004
7th July 2017, 08:52
I recommend qyot27's ffms2 C-plugin (http://avisynth.nl/index.php/FFMS2#C_Plugin).
StainlessS
7th July 2017, 08:56
FFmpegSource: (ffms2)
https://forum.doom9.org/showthread.php?t=127037
LSmashSource: (LSMASHVideoSource)
https://forum.doom9.org/showthread.php?t=167435
Both in Avs Devs forum, seems devs dont think that they are of interest to users.
LSmash, has two video decoders,
LSMASHVideoSource for ISO
Function IsISOFileName(String s) {
s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")}
Otherwise use LWLibavVideoSource.
MrVideo
7th July 2017, 09:05
I recommend qyot27's ffms2 C-plugin (http://avisynth.nl/index.php/FFMS2#C_Plugin).
Any particular reason?
EDIT: I see that his requires AVISynth 2.6.0 (or later). Does the github 2.23.1 do so as well?
I have a version of 2.6.0, but haven't installed it. I'm running XP-64 (yes it is old, but works for what I need).
Groucho2004
7th July 2017, 09:12
Any particular reason?
EDIT: I see that his requires AVISynth 2.6.0 (or later). Does the github 2.23.1 do so as well?
I have a version of 2.6.0, but haven't installed it. I'm running XP-64 (yes it is old, but works for what I need).
I have not tried all variations of ffms2/lsmash but this one just works (also on XP32/64, the latest ffms/lsmash will not work on XP).
If you don't have Avisynth(+) 2.6 installed you should really do so.
Sharc
7th July 2017, 09:46
If you don't have Avisynth(+) 2.6 installed you should really do so.
Note for MrVideo: BD-RB does not (yet) support AVS+.
MrVideo
7th July 2017, 09:54
I have not tried all variations of ffms2/lsmash but this one just works (also on XP32/64, the latest ffms/lsmash will not work on XP).
Then that is a good reason to use his.
If you don't have Avisynth(+) 2.6 installed you should really do so.
As noted above, I can't, because I use BDRB.
While I have a Win7 box (recently brought up), the XP64 box is only meant for x264 recoding and BDRB authoring use.
feisty2
7th July 2017, 09:58
I have not tried all variations of ffms2/lsmash but this one just works (also on XP32/64, the latest ffms/lsmash will not work on XP).
If you don't have Avisynth(+) 2.6 installed you should really do so.
Except no one else cares about xp support.
"I don't wanna upgrade to win10 for various reasons."
"Switch to Linux" - Good
"Xp till death" - Bad
Sharc
7th July 2017, 10:09
Then that is a good reason to use his.
As noted above, I can't, because I use BDRB.
You can upgrade from Avisynth 2.5.8 to Avisynth 2.6.0, but not to AVS+ for BD-RB.
MrVideo
7th July 2017, 10:19
You can upgrade from Avisynth 2.5.8 to Avisynth 2.6.0, but not to AVS+ for BD-RB.
I will be upgrading to 2.6.0.
MrVideo
7th July 2017, 10:27
Except no one else cares about xp support.
There are still many who do.
"I don't wanna upgrade to win10 for various reasons."
It is really evil. The stranglehold it puts on users is horrible. The crap I had to go thru to get Win7 running so that I, as the only user, could actually use the box.
"Switch to Linux" - Good
I run a Fedora 25 server. Unfortunately, no one ports any of the programs I need to use on Linux (Adobe, AVISynth, BDRB, VideoReDo and many others).
"Xp till death" - Bad
But, it continues to work for what I need.
On all three of my XP/Win7 boxes, I have cygwin installed so that can do lots of stuff. I have scripts that do my AVISynth jobs. No GUI required.
Groucho2004
7th July 2017, 10:46
When I wrote "Avisynth(+)" I meant either Avisynth 2.60 (classic) or AVS+ (which is also v2.60).
If you want some flexibility or want to try out other Avisynth versions you could give this (https://forum.doom9.org/showthread.php?t=172124) a try.
Groucho2004
7th July 2017, 10:47
Except no one else cares about xp support.Funny that all Avisynth versions and ~99% of plugins work fine on XP.
feisty2
7th July 2017, 11:01
it's not a stranglehold, no one said "you HAVE TO upgrade to win10", sure you have every right to avoid win10 if that's what you want.
BUT, if you're gonna do that, you just have to plan for something else, obsolete software is simply toxic, especially ancient antique like xp, it's been 16 years since the initial release of xp...
generally, you would update that antique to the latest version of the same thing (that is, win10), but you find win10 is somehow not what you want, then, you should really pick something else, maybe Linux, or OSX, whatever you like.
xp should die cuz it also fails to work with modern hardware (at least it couldn't release the full potential of the modern hardware, you have no AVX, FMA and stuff with xp).
it might work for what you need, FOR NOW, but it works with lower efficiency, and that's very harmful.
xp is an obsolete program, not your soulmate, it would be extra easy to get rid of if only you could just let go
feisty2
7th July 2017, 11:05
Funny that all Avisynth versions and ~99% of plugins work fine on XP.
that's because country bumpkins like you demanded it
Groucho2004
7th July 2017, 11:28
that's because country bumpkins like you demanded itWho are you and what have you done to feisty2? He would never spell the word "because" in this obsolete manner.
feisty2
7th July 2017, 11:48
Who are you and what have you done to feisty2? He would never spell the word "because" in this obsolete manner.
Save your sarcasm for your xp sinking ship, maybe one day the gravity on earth suddenly disappears and the hardware manufacturers choose to again, support xp
Groucho2004
7th July 2017, 11:53
Save your sarcasm for your xp sinking ship, maybe one day the gravity on earth suddenly disappears and the hardware manufacturers choose to again, support xp
I'm curious about why you get so rowled up about people who still use XP. Is it the brain-washing by M$ and its minions? Why do you even care?
MrVideo
7th July 2017, 11:59
When I wrote "Avisynth(+)" I meant either Avisynth 2.60 (classic) or AVS+ (which is also v2.60).
Ah, gotchya.
If you want some flexibility or want to try out other Avisynth versions you could give this (https://forum.doom9.org/showthread.php?t=172124) a try.
Very interesting. I've downloaded it. Don't know if I'll play with it yet.
Does the bat file contain a reference URL to your thread? Even if it is just a comment.
feisty2
7th July 2017, 12:03
I'm curious about why you get so rowled up about people who still use XP. Is it the brain-washing by M$ and its minions? Why do you even care?
I don't give a damn about ms.
My hate for xp has nothing to do with ms and if ms goes bankrupt now, I would still hate xp, simply because it's OBSOLETE
I hate anything obsolete, so it's not just xp exclusively
MrVideo
7th July 2017, 12:03
I'm curious about why you get so rowled up about people who still use XP. Is it the brain-washing by M$ and its minions? Why do you even care?
Maybe he wants to get his licks in before the big one that results in SF and LA sliding into the ocean. :D
MrVideo
7th July 2017, 12:06
I hate anything obsolete, so it's not just xp exclusively
Does that mean you buy a new phone as soon as the model you have becomes obsolete by the newer version? Must be nice to have to funds to do that with every new phone model.
Oh, and there are still owners of Model-T fords. Do you hate those cars too?
Groucho2004
7th July 2017, 12:07
Does the bat file contain a reference URL to your thread? Even if it is just a comment.No, I'll add it in the next version.
feisty2
7th July 2017, 12:13
Does that mean you buy a new phone as soon as the model you have becomes obsolete by the newer version? Must be nice to have to funds to do that with every new phone model.
Oh, and there are still owners of Model-T fords. Do you hate those cars too?
And that's totally different
A new cellphone costs you money and a new copy of software sometimes costs you nothing (win10 is free, linux is free...)
MrVideo
7th July 2017, 12:22
And that's totally different
A new cellphone costs you money and a new copy of software sometimes costs you nothing (win10 is free, linux is free...)
In theory XP, Vista (Yuck!), Win7, Win8/8.1, all supposedly cost money. So, your argument doesn't hold water. Like a new phone, a newer version of M$ OS software is supposed to cost money.
Some of the software I'm running on XP, I can't even get updated for Win7. It isn't just the OS that costs, many a time you have to buy a newer version of a program to use on that newer OS (usually at a discount, but still).
Just because you don't like a lot of obsolete stuff, doesn't that everyone else has to as well.
feisty2
7th July 2017, 12:26
And model-T fords are now meant to be some kind of antique collection, not something you would actually drive on the street,,,
Same goes for xp, using xp for your daily work is kind of similar to driving model-T on the street, which is simply not appropriate
Sharc
7th July 2017, 12:34
And that's totally different
A new cellphone costs you money and a new copy of software sometimes costs you nothing (win10 is free, linux is free...)
Well well.... with Win10 users supply them via the default telemetering a lot of information free of charge how they use their PC etc.
MrVideo
7th July 2017, 12:34
And model-T fords are now meant to be some kind of antique collection, not something you would actually drive on the street,,,
Funny, I've seen model T being driven on the street.
Same goes for xp, using xp for your daily work is kind of similar to driving model-T on the street, which is simply not appropriate
My main daily work is done on my Linux server, like using a browser. Downloading files. The XP/Win7 boxes have specific functions.
feisty2
7th July 2017, 12:41
Funny, I've seen model T being driven on the street.
My main daily work is done on my Linux server, like using a browser. Downloading files. The XP/Win7 boxes have specific functions.
I've seen people cheating during the tests, does it mean that cheating is appropriate?
Groucho2004
7th July 2017, 12:45
Same goes for xp, using xp for your daily work is kind of similar to driving model-T on the street, which is simply not appropriateIn my day job I have to use XP because some of the software I need does only run on NT4/W2K/XP/Server2003. Appropriate or not, that's how it is. You clearly have no clue of what's going on in some professional environments.
Also, the BS about security is just M$ spreading FUD. I have a box with XPSP1 and a properly configured Outpost firewall which has never caught any worm/virus. The problem is almost always an idiot user who clicks on an email attachment or a web dialog that will install nasty crap.
manolito
7th July 2017, 13:27
To get back on topic, a good alternative to ffms2 (like Groucho I also prefer the C-Plugin version by quot27) is DSS2Mod by forclip.
It is based on Haali's DSS2, but much better... Just place the correct DLL in your AviSynth\Plugins folder (there are separate DLLs for AVS 2.5 and 2.6) and call it like this:
DSS2("My File", fps={source fps}, Preroll=15)
It is DirectShow based (I know a lot of people will cringe when they hear this), but with the exposed Preroll parameter it does a much better job when seeking. It only handles video, it always uses the "Convertfps=true" parameter, i.e. it always converts VFR to CFR. In my experiece it gives ffms2 a run for the money...
Cheers
manolito
manolito
7th July 2017, 13:33
Also, the BS about security is just M$ spreading FUD. I have a box with XPSP1 and a properly configured Outpost firewall which has never caught any worm/virus. The problem is almost always an idiot user who clicks on an email attachment or a web dialog that will install nasty crap.
Totally agreed, my experience with XP is the same. I do run XP and Win7 in parallel, I never caught any malware under both OS, I even got rid of my AntiVirus software and just use the good old (and of course obsolete) ThreatFire (a behavioral scanner, no AV signatures, very light on resources).
For idiot user definition I would add that such users never back up their computers. And when disaster strikes they call folks like me to help them. And a few months later I find that they still make no backups...
Cheers
manolito
feisty2
7th July 2017, 14:04
To get back on topic, a good alternative to ffms2 (like Groucho I also prefer the C-Plugin version by quot27) is DSS2Mod by forclip.
It is based on Haali's DSS2, but much better... Just place the correct DLL in your AviSynth\Plugins folder (there are separate DLLs for AVS 2.5 and 2.6) and call it like this:
DSS2("My File", fps={source fps}, Preroll=15)
It is DirectShow based (I know a lot of people will cringe when they hear this), but with the exposed Preroll parameter it does a much better job when seeking. It only handles video, it always uses the "Convertfps=true" parameter, i.e. it always converts VFR to CFR. In my experiece it gives ffms2 a run for the money...
Cheers
manolito
Is it frame accurate? (Dunno about DSS2, but DSS is not)
manolito
7th July 2017, 14:21
From the DSS2Mod readme:
7. Added "preroll" setting (int, default = 0, if < 0 rounded to 0). Since DirectShow seeking isn't frame-accurate (or time-accurate,
as there is no frames, only time), when we perform a seeking to calculated time position, in some cases we can "overseek" or "overjump"
requested position. Also with some decoders or files you may see alot of artifacts after seeking (has something to do with GOP and keyframes).
"preroll" - it's a number of frames that will be minused from the requested frame No. when calculating desired time position for seeking.
All "extra-frames" will be read frame-by-frame till we get what we want. Or in other words: we want frame No. 100 and preroll=10;
seeking will be performed, as if we need frame No. 90; frames from 90 (or where we will be after seeking, since it isn't accurate most of the time)
to 100 will be safely readed frame-by-frame. If after seeking you can see artifacts or frozen frames for some time - you may want to increase preroll
value to 10, 20,... or probably 100 and even more (for ts\m2ts files). Or repack your file to something more seekable. Or use DGDecNV.
For problematic files like H264 or H265 interlaced transport streams the Preroll param should be set to a value of 100 or higher. For "normal" sources I always get frame accurate seeking with Preroll set to 15.
Cheers
manolito
MrVideo
7th July 2017, 22:49
While my H.264/4:2:2 videos will be interlaced, I will not be seeking to any particular location. I will be recoding from the first frame through to the last. Depending on the source, I will be IVTCing it, or leaving it as interlaced.
manolito
7th July 2017, 23:11
Then I would suggest to give DSS2Mod a test run. It is faster than ffms2 because it does not index the source.
Frameserving the source in a linear mode is one thing. Another thing to keep in mind is when using temporal filters which request frames before and after the current frame. This must be considered as "seeking". MVTools for example is notorious for requesting out of order frames when doing its motion vector thing.
Cheers
manolito
MrVideo
7th July 2017, 23:33
Then I would suggest to give DSS2Mod a test run. It is faster than ffms2 because it does not index the source.
Indexing doesn't bother me. I've been doing it for years now with the DG tools. It only takes a few minutes, A drop in the bucket compared to the actual coding time.
Frameserving the source in a linear mode is one thing. Another thing to keep in mind is when using temporal filters which request frames before and after the current frame. This must be considered as "seeking". MVTools for example is notorious for requesting out of order frames when doing its motion vector thing.
I will be doing 2-pass recoding. The keeping it as 1080i would mean no seeking (I hope). The tools I'll be using to do the IVTC are as shown in the first posting. So, you are right, there is probably seeking involved there. I do not know.
Sharc
8th July 2017, 07:48
@MrVideo
By the way: Did you ever try to IMPORT your 4:2:2 source in BD-RB? Since version 0.50.23 it supports importing of certain 4:2:2 lossless video formats and converts it to 4:2:0 YV12 on the fly for further processing and encoding with x264.
MrVideo
8th July 2017, 11:41
By the way: Did you ever try to IMPORT your 4:2:2 source in BD-RB? Since version 0.50.23 it supports importing of certain 4:2:2 lossless video formats and converts it to 4:2:0 YV12 on the fly for further processing and encoding with x264.
It isn't lossless. It is H.264/4:2:2.
Sharc
8th July 2017, 11:53
It isn't lossless. It is H.264/4:2:2.
So can you IMPORT it in BD-RB or not?
Groucho2004
8th July 2017, 12:08
If you want some flexibility or want to try out other Avisynth versions you could give this (https://forum.doom9.org/showthread.php?t=172124) a try.
Very interesting. I've downloaded it. Don't know if I'll play with it yet.It's the easiest way to install/switch/uninstall Avisynth even for "GUI" people with very little knowledge of CLI/batch files.
MrVideo
8th July 2017, 12:13
So can you IMPORT it in BD-RB or not?
No idea at this point. Will check later. The point is that it isn't lossless, i.e., not one of the new supported formats.
Sharc
8th July 2017, 12:19
No idea at this point. Will check later. The point is that it isn't lossless, i.e., not one of the new supported formats.
If IMPORT with BD-RB fails you can open your H.264 4:2:2 in VirtualDub FilterMod (google for it) and convert it to a format of your convenience.
MrVideo
9th July 2017, 02:51
If IMPORT with BD-RB fails you can open your H.264 4:2:2 in VirtualDub FilterMod (google for it) and convert it to a format of your convenience.
I prefer to do all of this with my scripts and avoid dealing with a GUI. Same with using BDRB, i.e., a GUI.
By using my scripts, I just drop the files onto the computer, add them to the "doit" script, select the option template and let it run. I can do multiple files with no hand holding and do other things while the job is running.
MrVideo
12th September 2017, 08:11
So can you IMPORT it in BD-RB or not?
I finally got a chance to get back to this project.
Well, I'll be damned. I imported a TS file and it took it. It mangled the audio, but I don't care about that, as I'll be dealing with that separately.
I then clicked on BACKUP and it actually re-encoded it to 4:2:0. It did it as 1-pass though. I need to find the option to get it to do 2-pass encoding.
MrVideo
3rd October 2017, 15:24
Problem has been solved. I've discovered that x264 can directly read in the h.264/4:2:2 video and recode it to h.264/4:2:0. :D
poisondeathray
3rd October 2017, 16:18
Problem has been solved. I've discovered that x264 can directly read in the h.264/4:2:2 video and recode it to h.264/4:2:0. :D
Only if it's progressive.
It won't perform interlaced downsample correctly
MrVideo
4th October 2017, 00:27
Only if it's progressive.
It won't perform interlaced downsample correctly
Looks great. I see nothing wrong with the interlaced output.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.