View Full Version : Using AvsPmod to deinterlace HD video (Newbie)


Master Tape
16th June 2018, 03:11
I want to be able to deinterlace MP4 files using QTGMC in AvsPmod, but can't seem to be able to play the preview window to see the difference.. The source is PAL 1080i 50fps (the field rate) I'd like to keep it to 50 frames though to maintain the smooth playback.

How do i export the video to create a deinterlaced MP4 file?

Here's the script i got so far..

SetMTMode(5, 4)
LoadPlugin("C:\Users\Desktop\Plugins\LSMASHSource.dll")
LSMASHVideoSource("C:\Users\Desktop\Video Files\BBC One.mp4")
AssumeFPS(25)
Audio=true
ConvertToYV12()
SetMTMode(2)
AssumeTFF()
QTGMC( Preset="Slower", SourceMatch=3, Lossless=2, EdiThreads=1 )

Shirtfull
16th June 2018, 12:38
Avisynth and plugins installed?

Master Tape
19th June 2018, 01:32
Yes everything i need is all installed.

lansing
19th June 2018, 02:11
What is the error message?

Master Tape
21st June 2018, 00:05
The issue is, when i double click on the batch file, the black command screen pops up with all the running text, but it stops and doesn't encode the video.

I've used these settings in the batch file specifically for Youtube.

ffmpeg -i "Tutorial.avs" -c:v libx264 -preset slow -crf 17 -c:a copy -pix_fmt yuv420p output.mkv "C:\Users\Desktop\Tutorial\BBC1.mp4"

Don't know i'm missing something, or one of the settings is wrong? Again like i said, i'm all new to this.

StainlessS
21st June 2018, 00:21
but can't seem to be able to play the preview window

So have you solved your initial/(subject of thread) problem, otherwise, what has ffmpeg got to do with it ?

What is the error message?

Yeh, you are gonna have to be a little less obfuscated [bit more clear] if you want some kind of assistance from the guys.

patul
21st June 2018, 08:48
The issue is, when i double click on the batch file, the black command screen pops up with all the running text, but it stops and doesn't encode the video.


I dont know anything about it, but if it is really a batch script (.bat), you can open Command Prompt and run the batch file from there instead of double click it. You'll be able to read the error message, then post it here so somebody can help.

Master Tape
23rd June 2018, 19:58
So have you solved your initial/(subject of thread) problem, otherwise, what has ffmpeg got to do with it ?

No i'm still stuck on how to export/render the video so it's then deinterlaced for online distribution. I've saved the script, and have created a .bat file.

FFmpeg is the encoder i'm using to output the final video. I'm just having issues and don't know if i'm doing it right.. I double click the .bat file to start encoding but it just grinds to a halt, and goes 1fps.... 2fps...3fps... and so on but seems to take forever, and isnt even rendering the video correctly. After leaving it for 16 hours, the 20 second clip came out funny, kept duplicating the same few frame every 2 seconds or so and has no sound.

Yeh, you are gonna have to be a little less obfuscated [bit more clear] if you want some kind of assistance from the guys.

Yeah sorry, it's just this whole process is a little more complicated than i feared lol.

I dont know anything about it, but if it is really a batch script (.bat), you can open Command Prompt and run the batch file from there instead of double click it. You'll be able to read the error message, then post it here so somebody can help.

Yeah it's a (.bat) file. Can't see any error message but here is a screenshot of what is says whilst trying to encode.

https://i.imgur.com/COMz2dA.png

StainlessS
24th June 2018, 08:51
I'm still not sure that anybody knows what the actual problem is.

Firstly, Avisynth should produce a simulated *.AVI file, any avi player should be able to play the result, eg your Media Player of choice,
right click YourFile.avs, select 'Open With'. Or to view save as real avi then eg 'Open With' VirtualDub2. Select Save As in VirtualDub2 and save it.
[After selecting Video/FastRecompress and Video/Compression (perhaps use Ut_Video codec)]

If saved, then the file will be a real avi, and if you later need it in avs form again then could use something like this


Return AviSource("myNewAviFile.avi")


Use that as input to your ffmpeg thing, already deinterlaced etc.

I dont use AvsPMod and dont recall much about it, but either a media player or Vdub2 should display any error message that you may be getting.
(If you can clear error, then should be able to feed fixed original script directly into ffmpeg).

EDIT

SetMTMode(5, 4)
LoadPlugin("C:\Users\Desktop\Plugins\LSMASHSource.dll")
LSMASHVideoSource("C:\Users\Desktop\Video Files\BBC One.mp4")
AssumeFPS(25)
Audio=true # this does nothing, and you do not have any audio
ConvertToYV12()
SetMTMode(2)
AssumeTFF()
QTGMC( Preset="Slower", SourceMatch=3, Lossless=2, EdiThreads=1 )


Maybe something more like this, untested

# SetMTMode(5, 4) # Walk before you can run (I dont use MT stuff and have no idea what this line does)
LoadPlugin("C:\Users\Desktop\Plugins\LSMASHSource.dll")
FN="C:\Users\Desktop\Video Files\BBC One.mp4"
LSMASHVideoSource(FN)
Audio=LSMASHAudioSource(FN)
AudioDub(Audio)
#Return Info() # UnComment to show/return info without deinterlace
AssumeFPS(25) # I presume that it is already 25.0 FPS so probably NOT needed
ConvertToYV12() # I presume that it is already YV12, so probabvly not needed
#SetMTMode(2) # Lets learn to walk first
AssumeTFF()
QTGMC( Preset="Slower", SourceMatch=3, Lossless=2, EdiThreads=1 )
#QTGMC( Preset="Slower") # No idea what above does, I would just use simpler stuff, out would be 50.0 FPS
#QTGMC( Preset="Slower").SelectEven # 25.0 FPS


EDIT: VDub2 recommended for testing.

Master Tape
25th June 2018, 18:19
Good call on not using the MT stuff, everything seems to be running alot smoother, it's actually rendering in FFmpeg now! Probably was putting too much pressure on my CPU and throttling it.

The issue i have now is that the rendered video keeps jumping back a few frames/stuttering every second or so, but the audio is still playing at normal speed. The original video is flagged up as 50fps (probably because it's an interlaced video which has 50 fields per second but it's declaring it as the frame rate) After removing Assume25fps the video runs too fast, on top of the other problem.

Also have the same issue when i save as AVi file in VirtualDub2 so must be a problem somewhere in the script.

Here's the sample video to show what i mean. (http://sendvid.com/wwu6x8mi)

QTGMC( Preset="Slower", SourceMatch=3, Lossless=2, EdiThreads=1 )
#QTGMC( Preset="Slower") # No idea what above does, I would just use simpler stuff, out would be 50.0 FPS

SourceMatch and Loseless are used for 'exacting detail'

From QTGMC wiki:
Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again.

Though in using them i run into render freezes again. Don't understand it though as i have an i7-6700K and 16GB RAM, so not like i'm lacking the memory to run it faster through multi-threading.

lansing
26th June 2018, 03:14
What happen when you preview the script in avspmod? Does the looping problem exist there?

Master Tape
26th June 2018, 19:29
What happen when you preview the script in avspmod? Does the looping problem exist there?

Hard to tell as it struggles to play the video, like it's too much pressure on the processor. Playing the preview is not really displaying it in motion, more like a series of still pictures.

lansing
26th June 2018, 21:49
Hard to tell as it struggles to play the video, like it's too much pressure on the processor. Playing the preview is not really displaying it in motion, more like a series of still pictures.

By preview I mean loading the script into avspmod, click on the preview button on the bottom, and tapping the left/right arrow key. Did you see the looping problem there?

Master Tape
27th June 2018, 00:27
By preview I mean loading the script into avspmod, click on the preview button on the bottom, and tapping the left/right arrow key. Did you see the looping problem there?

Oh i see. After going through it frame by frame in avspmod, the looping problem is still present.

kuchikirukia
28th June 2018, 03:51
Take out QTGMC and replace with bob(). If it still does it your source is borked, switching between top and bottom fields first. You can try demuxing it or muxing it to mkv and using LWLibavVideoSource or FFMS2 and see if either do better.

With QTGMC you really want to add setmemorymax(1000) somewhere, and sourcematch and lossless do really badly on HD material for me.