PDA

View Full Version : Some Win workflow tricks and tips



SLoNiCK
05-14-2009, 02:53 AM
Playback:

I installed Haali splitter to treat MPEG TS container and ffdshow for decoding. This combo is universal, independent of any other players, codecs, and sufficient for playback in any application that uses DirectShow.

Pulldown removal:

NLE-agnostic method - AviSynth + VirtualDub.
I created script (simple text file with .avs extension, notepad will do the job):
DirectShowSource("filename.mts").AssumeTFF().DoubleWeave().Pulldown(0,2)
It opens video via DirectShow, assumes that top field is first and removes pulldown. You can drop it to VDub and transcode with any VfW codec into .avi. Most transcoding programs (procoder, avidemux ...) will accept it, too.

Edius (ver. 5.1) way.
I used free utility - AVCHD converter made by Canopus/Thomson. It converts .mts AVCHD to CanopusHQ. Just select files you need in Explorer/Total commander, click RMB, select "convert with AVCHD2HQ" (this menu item appears after utility installation). You can configure it by starting the AVCHD2HQ utility itself. BTW, it also can recompress .mts into HDV/MPEG2, but AFAIK it requires Edius anyway, so it won't be a standalone solution.
Then I started new Edius project - 1080p23,98 and threw in .avi files. Edius is smart enough to remove pulldown.
NB: project must have _23,98_, NOT 24 framerate, or you'll get some ghosting artifacts.

Hope it wil help.

SLoNiCK
05-14-2009, 03:53 AM
Some sick scripting...

Well, AviSynth is a handy tool for video processing, but it's painful to create .avs for every video file by hands. There are some tools to automate the process, but actually we can handle it with utils we already have. I'll show you the script that will take .mts files in given folder, remove pulldown in 1080 ones, and recompress them to intermediate format (CanopusHQ in my case). What for? True 24p files can be easily imported into any NLE without any headache. Besides, it will need less space to store and less bandwidth to play for the same quality, especially with intraframe codecs.

Let's start. Create blank text document. Write this:

for %%f IN (*.mts) DO (
echo v_in = directshowsource^("%%f"^) > %%~nf.avs
echo v_out = ^(width^(v_in^)==1920^) ? v_in.assumetff^(^).doubleweave^(^).pulldown^(0,2^) : v_in >> %%~nf.avs
echo return v_out >> %%~nf.avs
)

save it as ..mmm... "mts2avi.bat" - executable batch file. What does it make? For every _name_.mts file in a given folder it will create a _name_.avs script. This script opens .mts, checks if video width is 1920, and if it is - removes pulldown. Run it, then open any .avs file in VDub. Select compression codec, save processing setting ("file" menu item or Ctrl+S). Save it with any name, open in notepad (yes, it's just a text file again). Look for the string like:
VirtualDub.video.SetCompression...

Remember it. Now let's add some stuff to our .bat file:

for %%f IN (*.avs) DO (
echo VirtualDub.Open^("%%f"^); > %%~nf.script
echo VirtualDub.video.SetCompression^(0x63767563,0,1000 0,0^); >> %%~nf.script
echo VirtualDub.SaveAVI^("%%~nf.avi"^) >> %%~nf.script
echo VirtualDub.Close^(^) >> %%~nf.script
)

for %%f IN (*.script) DO (
"C:\Program Files (x86)\vd\vdub.exe" /min /x /s %%~ff
)

This part will create scripts for processing in VirtualDub. "SetCompression" parameters must be as in "processing settings" file from VDub. Then it processes scripts with CLI variant of VDub (it is in the same directory with GUI variant, I keep it in "C:\Program Files (x86)\vd\", you shall type your path)

If you don't like the mess with all these .avs and .script files, add some strings at the end of our .bat file:

for %%f IN (*.script) DO (
del /Q %%f
)
for %%f IN (*.avs) DO (
del /Q %%f
)

It will simply delete temporary scripts.

SLoNiCK
05-17-2009, 09:13 AM
Those NTSC users who want to get 720p24 from 720p60 have a dilemma: throw 3 frames from every 5 and get some sharp but jerky video, or to blend 3rd and 4th frames and get smooth video with ghosting artifacts.

There is simple and free way that will reconstruct missing "frame №3.5" using advanced motion flow analysis. It's MVTools plugin for AviSynth. I'm using MVTools ver. 2. Just write this script:

directshowsource("_your_clip_.MTS")
super = MSuper(pel=2)
backward_vec = MAnalyse(super, isb = true)
forward_vec = MAnalyse(super, isb = false)
MFlowFps(super, backward_vec, forward_vec, num=23976, den=1000, ml=100)

and convert it into any acceptable format. It will produce both sharp and smooth video. BTW, you can try to get any fps you need - just set "num" and "den" (they must be integer) so
num/den=your_fps
But keep in mind that it isn't a 100% panacea. You can get artifacts on fast moving or blurry objects or regular structures like fences.

Here comes an example of 60p->24p conversion:
http://www.filefactory.com/file/ag0f49a/n/60to24_mpg

Schmoe
05-28-2009, 08:59 AM
Slonick,
I gave your AVIsynth to Virtualdub method a try, using the exact script you have posted above, on Solidstate's cat footage from this thread:
http://www.dvxuser.com/V6/showthread.php?t=170076

The result was a video with alot of lines that look like bad deinterlacing or maybe they would be called "pulldown artifacts". I don't really know, but they look like this ;)

http://img41.imageshack.us/img41/2653/catseye.jpg

Notice the horizontal lines. Not horrible, but not good either.

Schmoe
05-28-2009, 09:04 AM
BTW- I also tried pulldown removal with Neoscene on the same clip and the result was very nice, with no artifacts. I was really hoping to find a good freeware method for this, but it just may not be in the cards.

SonicStates
05-28-2009, 09:15 AM
Slonick,
I gave your AVIsynth to Virtualdub method a try, using the exact script you have posted above, on Solidstate's cat footage from this thread:


It's SONICSTATES :) and yeah the horizontals don't look so flash on that...

SLoNiCK
05-28-2009, 12:22 PM
Schmoe

Could you point what script are you using - simple .avs or result from a batch script? Frame number when you stuck on this issue? Then what soft (and version) are you using for TS demuxing, AVC and AC3 decoding and .avs scripting?

SonicStates

Just meet your destiny... Some day you'll turn into Solid Snake... :D

j
05-28-2009, 01:40 PM
"Solidstate" is a great handle...

Schmoe
05-28-2009, 04:30 PM
Slonick:
I'm using the following:
newest stable FFDShow - ffdshow-20020617.exe
newest Haali Media Splitter from January 1, 2009
newest stable AviSynth 2.5.8

I feed Virtual dub this AVS script:
DirectShowSource("filename.mts").AssumeTFF().DoubleWeave().Pulldown(0,2)
then took the frame capture directly from Virtualdub's input/AVISynth's Output.

I believe the frame cap was taken from frame 10, but they occur throughout the clip and are more noticeable on movement.

For example, I am seeing the artifacts on
frames 2,3
frames 6,7
frames 10,11
frames 14,15 and on and on in this pattern

Sonicstates:
Sorry about the name mixup, guess I was thinking about DC electronics for some reason. Maybe I should have taken the nickname "Solidstate" as you aren't using it... :-) As j points out, it's a pretty nice nick

Schmoe
05-28-2009, 05:51 PM
For what it's worth: The action in the AVISynth footage appears to be about one frame off from the Neoscene footage.

For example, frame 59 in the Neoscene footage is identical to frame 58 in the AVISynth footage(except the Neoscene footage has no progressive removal artifacts).

SLoNiCK
05-30-2009, 03:12 PM
Schmoe

Try this:
DirectShowSource("filename.mts").AssumeBFF().DoubleWeave().Pulldown(0,2)

Then try this:
DirectShowSource("filename.mts").AssumeBFF().DoubleWeave().Pulldown(0,1)

Maybe you should install some newer version of ffdshow. "20020617" is... ancient :)

For what it's worth: The action in the AVISynth footage appears to be about one frame off from the Neoscene footage.

Yeah, I've bumped on it, too. I've also met some blending artifacts, but they appear only in first 5 or 6 frames o_0

P.S. One more thing: does interlacing show on every 60i GH1 clip or just on some particular?

Schmoe
05-30-2009, 07:40 PM
Slonick: I replied over on the "Clever, FREE pulldown-removal & transcoding workflow via AviSynth" thread as several other people seem to be working on the problem over there

nathankw
06-21-2009, 02:52 PM
Slonick - thanks so much for this.
I've never delved into avisynth scripting but these instructions are really clear and I got it working no trouble. I'm in PAL land so I deleted the pulldown line and the result seems to work fine for both 1080 and 720 modes.

I was tearing my hair out trying to find an easy workflow and this is it!

SLoNiCK
06-23-2009, 06:51 AM
I'm glad it turned out usefull for you :thumbs: :)
You've made automated script without pulldown removal? I'm using it myself cause I'm PAL user, too.