Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th November 2012, 15:26   #1  |  Link
agni451
Registered User
 
Join Date: Jul 2012
Posts: 6
using qtgmc in ffmpeg

Is there any way to use qtgmc instead of the built-in yadif filter? My video files are mpeg2, and that should be Directshow compatible. My avs ("A.avs") looks like this:

Code:
SetMemoryMax(1600)
SetMTMode(3,8)


video=DirectShowSource("S:\TEST5\A.m2v")


SetMTMode(2)
video=video.AssumeTFF()
video=video.QTGMC(Preset="Slow")
video=video.SelectEven()


video=video.Lanczos4Resize(1920,1080)


video2=BlankClip(video,length=102)


return(video+video2)
and then the ffmpeg commandline looks like:

Code:
ffmpeg -v verbose -y -i "S:\TEST5\A.avs" -c:v libx264 -preset slow -b:v 7550k -r:v 30000/1001 -x264opts open-gop:b-pyramid=strict:slices=4:qpmax=51:nr=250 -f rawvideo "S:\TEST5\A.264"
Unfortunately all I get is "AFIFileOpen failed with error -2147221164. S:\TEST5\A.avs: Operation not permitted". Even when I just try to load the video in avisynth, no filters or anything:

Code:
DirectshowSource("S:\TEST5\A.m2v")
I get the same message. I am currently using the absolute latest version of ffmpeg (N-46469-gc995644 (Nov 5 2012)) with --enable-avisynth and --enable-libx264 and avisynth 2.58. I really need to be able to get the quality of qtgmc here, so how do I do this?
agni451 is offline   Reply With Quote
Old 10th November 2012, 16:09   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Are you trying to use 64 bit ffmpeg with 32 bit AviSynth?
Use a pipe or 32 bit ffmpeg.
sneaker_ger is offline   Reply With Quote
Old 11th November 2012, 00:55   #3  |  Link
agni451
Registered User
 
Join Date: Jul 2012
Posts: 6
Quote:
Originally Posted by sneaker_ger View Post
Are you trying to use 64 bit ffmpeg with 32 bit AviSynth?
Use a pipe or 32 bit ffmpeg.
yeah... so I was using 64-bit ffmpeg with 32-bit avisynth. So stupid. Now I have 32-bit ffmpeg, and when I try to open the single line avs script, it for some reason reads the video as 165x97 @ 33.33fps, when it's 1920x1080 at 29.97fps, and says "not divisible by 2" as well as "error while opening encoder for ouput stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"

I changed the longer avs script to what I'm used to- using DGIndex as a frameserver:

Code:
LoadPlugin("C:\Program Files (x86)\DGMPGDec\DGDecode.dll")
SetMemoryMax(1600)
SetMTMode(3,8)

video=MPEG2Source("S:\TEST5\A.d2v")

SetMTMode(2)
video=video.AssumeTFF()
video=video.QTGMC(Preset="Slow")
video=video.SelectEven()

video=video.Lanczos4Resize(1920,1080)

video2=BlankClip(video,length=102)

return(video+video2)
It reads it in correctly in terms of dimensions and fps, but it still gives that "error while opening encoder..." thing and then stops. Now what am I doing wrong?

EDIT: It is also giving the error "x264 [error]: malloc of size 8294400 failed"

Last edited by agni451; 11th November 2012 at 02:05.
agni451 is offline   Reply With Quote
Old 11th November 2012, 02:14   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
You may be running out of memory, try switching to a pipe:
avs2pipemod -y4mp script.avs | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -preset slow -b:v 7550k -r:v 30000/1001 -x264opts open-gop:b-pyramid=strict:slices=4:qpmax=51:nr=250 -f rawvideo "S:\TEST5\A.264"

You can also keep using ffmpeg 64 bit this way. (Faster and can use more memory.)
sneaker_ger is offline   Reply With Quote
Old 14th November 2012, 16:25   #5  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
Since only 8 MB of memory is not allocatable, it will crash even if divides process.
save number of threads from 8 to 4 or less.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 14th November 2012, 22:30   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by Chikuzen View Post
Since only 8 MB of memory is not allocatable, it will crash even if divides process.
save number of threads from 8 to 4 or less.
What is causing the problem and why can it be solved by reducing the number of threads?
sneaker_ger is offline   Reply With Quote
Old 16th November 2012, 13:31   #7  |  Link
agni451
Registered User
 
Join Date: Jul 2012
Posts: 6
Quote:
Originally Posted by sneaker_ger View Post
You may be running out of memory, try switching to a pipe:
avs2pipemod -y4mp script.avs | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -preset slow -b:v 7550k -r:v 30000/1001 -x264opts open-gop:b-pyramid=strict:slices=4:qpmax=51:nr=250 -f rawvideo "S:\TEST5\A.264"

You can also keep using ffmpeg 64 bit this way. (Faster and can use more memory.)
This works very well, thanks! I have another question though- what if I were to want to do a 2-pass encode using avisynth and have the .stats file in the working directory? How would that work with the avs2pipemod?
agni451 is offline   Reply With Quote
Old 16th November 2012, 19:28   #8  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
I don't quite understand. Why wouldn't it work?

You can do a short test if you just encode 1000 frames. (add "Trim(0,999)" to the last line of your script)
sneaker_ger is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.