Log in

View Full Version : Improving resolution


Pages : 1 2 3 4 [5]

Blue_MiSfit
20th March 2010, 02:23
The problem is the resolution that ffmpeg is seeing from avisynth. The tiny size probably means that avisynth is throwing an error.

Open you AVS in AvsP or VirtualDub, and see what the error message is :)

carlmart
20th March 2010, 13:26
Oh, I'm very much ashamed to say that the error was really my fault. Sorry!

The problem was that I was specifying a different file directory for ffmpeg than for AvsP, thinking I was correcting an error I had had in the past. As the file was loading correctly in AvsP and VD, then the problem was not in the script.

So I changed the directory for ffmpeg and conversion went fine.

Sometimes you think you are correcting things and are really messing it up... :(

Now I have a different problem, and would appreciate a suggestion: where would the trim line be placed.

I'm using the same script as above, changing the file name. It loads the file alright, but when I find the trim points and load them... I get a one frame long shot!

What might be happening?

D3C0D3R
25th March 2010, 12:27
for speed-up try to replace
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
by this
nnedi2_rpow2(rfactor=2, cshift="spline36resize")

nnedi2 is faster than nnedi and nnedi2_rpow2 made specially for enlarging images by powers of 2
(nnedi shifts chroma and after upscaling it can be visible).
also you can use McBob for deint - it slow, but the source 480p may be better. So 1080i will better too.

for more automate LaTo write resizing func.

# NNEDI2resize function by LaTo INV.
#
# PARAMETERS:
# -----------
# ox = destination width
# oy = destination height
# nsize,qual,pscrn,cshift = nnedi2 parameters
#
# ABOUT RESOLUTION:
# -----------------
# if output > input : use nnedi2 resizer + "cshift" resizer
# if output = input : do nothing
# if output < input : use "cshift" resizer
#
# EXAMPLE:
# --------
# NNEDI2resize(1280,720)
# NNEDI2resize(1920,1080,qual=1,cshift="spline16resize")

function NNEDI2resize(clip clp, int ox, int oy, int "nsize", int "qual", bool "pscrn", string "cshift")
{
nsize = default( nsize, 2 )
qual = default( qual, 3 )
pscrn = default( pscrn, true )
cshift = default( cshift, "spline36resize" )

ix = clp.width()
iy = clp.height()

rx = float(ox)/float(ix)
ry = float(oy)/float(iy)
rf = (rx > ry) ? rx : ry

clp = ( rf > 1.0 ) ? clp.nnedi2_rpow2(rfactor=ceil(rf/2.0)*2, nsize=nsize, qual=qual, pscrn=pscrn, cshift=cshift, fwidth=ox, fheight=oy)
\ : ( rf < 1.0 ) ? Eval( "clp." + cshift + "(" + string(ox) + "," + string(oy) + ")" )
\ : clp

return clp
}

carlmart
25th March 2010, 13:18
for speed-up try to replace
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
by this
nnedi2_rpow2(rfactor=2, cshift="spline36resize")

nnedi2 is faster than nnedi and nnedi2_rpow2 made specially for enlarging images by powers of 2
(nnedi shifts chroma and after upscaling it can be visible).

I tried it on AvsP. It doesn't seem to change much, but the AvsP screen is small, even if I now enlarge it quite a lot. A whole blowup might show improvements. Nnedi shifts chroma how and where to?


also you can use McBob for deint - it slow, but the source 480p may be better. So 1080i will better too.

I got some comments that McBob might not have quality enough or had some issues.


for more automate LaTo write resizing func.

# NNEDI2resize function by LaTo INV.
#
# PARAMETERS:
# -----------
# ox = destination width
# oy = destination height
# nsize,qual,pscrn,cshift = nnedi2 parameters
#
# ABOUT RESOLUTION:
# -----------------
# if output > input : use nnedi2 resizer + "cshift" resizer
# if output = input : do nothing
# if output < input : use "cshift" resizer
#
# EXAMPLE:
# --------
# NNEDI2resize(1280,720)
# NNEDI2resize(1920,1080,qual=1,cshift="spline16resize")

function NNEDI2resize(clip clp, int ox, int oy, int "nsize", int "qual", bool "pscrn", string "cshift")
{
nsize = default( nsize, 2 )
qual = default( qual, 3 )
pscrn = default( pscrn, true )
cshift = default( cshift, "spline36resize" )

ix = clp.width()
iy = clp.height()

rx = float(ox)/float(ix)
ry = float(oy)/float(iy)
rf = (rx > ry) ? rx : ry

clp = ( rf > 1.0 ) ? clp.nnedi2_rpow2(rfactor=ceil(rf/2.0)*2, nsize=nsize, qual=qual, pscrn=pscrn, cshift=cshift, fwidth=ox, fheight=oy)
\ : ( rf < 1.0 ) ? Eval( "clp." + cshift + "(" + string(ox) + "," + string(oy) + ")" )
\ : clp

return clp
}

What improvements would I have with "NNEDI2resize function by LaTo" over spline36resize?

carlmart
9th April 2010, 14:07
I am back with some good news and new problems.

The most important good news is that the editing is finished and final results are very very good. So a BIG thanks is in order first to every one that helped me here.

In due time I will upload the film file to Rapisdshare so you can go have a look, and hopefully enjoy it too.

The problems I am having now are centered on Avid. I can't seem to get an interlace artifact free copy on the tests I am carrying on. Ironically, the problem I am having is not on the upscaled shots, but on the HDV ones, that were imported direct from camera to Avid. So I don't think anyone here will be able to help me there if they don't know Avid.

What I could do was export a DV file that I would like to make a DVD off. The file is DV, but I think I can rename it avi and could be treated as such. My idea is to use avisynth to convert it to DVD ready files, perhaps even trying some filters to improve resolution.

Next wednesday there will be a big presentation for the film, which will be seen in 3 x 2 meters screen, for a probably 100 people audience. So I working over the clock to get a workable, artifact free HD copy by then.

2Bdecided
9th April 2010, 15:43
If the output is HDV, you just need to use a player which deinterlaces it on the fly - I can't see Avid (which I have no knowledge of) is breaking something on the way from interlaced HDV input to interlaced HDV input!

If the output isn't HDV, what are you rendering to?

Cheers,
David.

carlmart
9th April 2010, 17:42
If the output is HDV, you just need to use a player which deinterlaces it on the fly - I can't see Avid (which I have no knowledge of) is breaking something on the way from interlaced HDV input to interlaced HDV input!

No, the output is not HDV. I wouldn't have any use for it. It's not a home system or something broadcasts air with. Broadcasting is done with 720p and 1080p. So in my mind is no longer part of the equation as soon as it's captured.

If the output isn't HDV, what are you rendering to?.

1080i for interlaced or 720p for progressive.

carlmart
10th April 2010, 01:51
What should I use to input a .dv file into an script?

I did try changing dv by avi and using avisource, but I get a "couldn't open file" message.

I will also have to demux the file to get my audio out.

Blue_MiSfit
11th April 2010, 02:41
.DV is tricky. I would export from Avid into something else, maybe DNxHD?

You can load this in to avisynth using FFMS2 (or directly with x264 now).

~MiSfit

carlmart
11th April 2010, 15:32
.DV is tricky. I would export from Avid into something else, maybe DNxHD?

You can load this in to avisynth using FFMS2 (or directly with x264 now).


I seem to be getting to the trickier and probably most critical part of my edit: how to export it.

Perhaps I should concentrate on one thing: exporting an HD file that I can manage and get my SD conversions from it.

No problem in exporting DNxHD, but Avid only exports as QT movie from my 1440x1080 timeline. A pity, because on the short tests I made I got best image results from a QT reference.

The program I am using to convert the mov file onto H264 is Sorenson Squeeze. I also tried Carbon Coder, which supposedly is better, but I got interlace artifacts from it, as I did on my first Squeeze conversions. Tried several combos on Squeeze until I cured the artifacts. But I'm not too happy with Sorenson Squeeze.

The problem, to put it straight on the table, is how to get from a mov file to an MKV file, which is the one I will be playing next wednesday on the pre-release presentation.

The mov to H264 conversion is the key, as it has to handle video & audio at the same time. The H264 program has to merge both onto a single file, or the MKV file won't play.

I know that because I tried doing video & audio separate mixdowns, video converted to H264 and audio to AC3, then merged them with MKV merge. The result did not play on my LG BD390 which plays all my MKVs.

As the export and conversions take several hours, I have to be very careful on what path to go now. I already did several short tests to compare results, and it's about 1 hour or more per minute. As my film is 26 minutes long, just add it up. Can't afford to miss.

carlmart
11th April 2010, 19:21
A smaller question: can I go fom a mov file to dvd files with avisynth?

How do I load the file in the script?

2Bdecided
12th April 2010, 16:48
1080i for interlaced or 720p for progressive.1080i WHAT?! For what?

"Interlaced artefacts" are a result of watching something that's interlaced without deinterlacing. 1080i is interlaced. Therefore, the problem is with your viewer, not the export.

If 720p also shows interlaced artefacts, then I agree - export (or deeper) problem!

Cheers,
David.

carlmart
13th April 2010, 18:47
As we speak I am running a mov to DVD files conversion using TMPGEnc 4.0 Xpress. I would have preferred to use Avisynth for this, as I thnk I might get better results. But I don't know how to load a mov file onto a script.

Unfortunately I also had to give up, for now, on an HD mp4 conversion from my mov original. Both programs I tried, Sorenson 6 and Carboncoder, who are supposed to process everything, stop in mid conversion providing no hint on what made them stop.

An HD mp4 is the only option I have to put inside an MKV file that I can play from my BD player and get an HD I can play from disc, besides using a BD burner which I do not have to burn a BD disc.

In any case yesterday I made a DVD copy from another mov (QT movie instead of the QT reference I am using now), and the final DVD played beautifully on my BD player, which upscales SD.

carlmart
16th April 2010, 13:29
Just to put an end, relative or final, to this story.

I could at last generate a full MP4 copy of my film. I ended up using Carboncoder, after failures with Sorenson Squeeze and QT Pro.

And I could get to that copy after a Carboncoder failure too, apparently because there was a program running: Windows Explorer.

All these programs seem very sensitive: not only do they fill up both CPU cores, as they do not tolerate any other thing running. Or you risk the program stopping the conversion and becoming inactive.

But contrary to the others I tried, Carboncoder got a copy with absolutely none interlace issues, be it on the movements, pans or final titles. Everything was fluid, as was on the Avid timeline, except with a much better image quality, really HD.

In any case I will still replace the DV upscales, that were 1920x1080, for new ones: 1440x1080. I feel some of the problems I had in the conversion are related to that: having 1920 and 1440 material on the same timeline.

Even if there might be new chapters to this story, I wish to thank you all for the effort and generosity in helping me. In the future I will upload the final film, with subtitles and in HD, to Rapidshare so you can see what we could achieve.

Thanks again!

2Bdecided
16th April 2010, 16:02
Glad you made it.

It's surprising how flaky certain video tools are. AVIsynth is exceptionally good in this respect (unless abused).

x264, usually via MeGUI, is the mp4 encoder of choice for many around here. I'm not sure how to get MOV into it either.

Cheers,
David.

Bordo32
26th January 2011, 07:34
Carlmart,
It is been awhile you were experimenting with the script to upscale DV to HD.
Can you please share if you have made any improevements and post your final script.

carlmart
26th January 2011, 21:02
I'm sorry. But I think I did post my final script. In any case it was this:

AVISource("e:\file.avi")
converttoyv12(interlaced=true)
TempGaussMC_beta1mod(EDIMode="NNEDI2")
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
BlindDeHalo3(rx=3.2,ry=1.5)
#sharpen(0.3)
spline36resize(1440,1080)
return last
separatefields.selectevery(4,0,3).weave

As soon as I upload to Rapidshare a copy of the video with English subs, I will let you know. It will be a pleasure to have all people who helped me here have a look.


Carlos

Gavino
27th January 2011, 11:47
...
return last
separatefields.selectevery(4,0,3).weave
Because of the return statement, the last line of your script is not used - is that intentional?

carlmart
27th January 2011, 12:17
No. I think I was just lazy and didn't cut it. :)

2Bdecided
27th January 2011, 13:19
Anyone picking the script up and using it today should try qtgmc in place of TempGaussMC_beta1mod for a significant speed increase (essentially the same quality).

Cheers,
David.

Bordo32
28th January 2011, 21:27
Carlmart, thanks for keep developing this process.

QTGMC looks interesting, would be helpfull to get recomendations on an actual settings, as a starting point.

2Bdecided
3rd February 2011, 14:28
QTGMC looks interesting, would be helpfull to get recomendations on an actual settings, as a starting point.As a starting point, don't use any settings! Defaults are fine.

Cheers,
David.