Quantcast Mencoder: FFmpeg with Avisynth Support - Page 2 - digitalFAQ.com Forums [Archives]
  #21  
05-09-2004, 11:16 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
And what about you, VM?. You were also testing it.
But I'm afraid you don't have the time...
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
05-12-2004, 05:48 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
After successful compilation of mencoder in mingw I decided to implement Avisynth support directly to mplayer/mencoder. You can download it from http://ffdshow.sf.net/mencoderAVS.rar. This time it contains avisynth_c.dll too. It isn't compiled with DirectX support therefore mplayer is not very usable.

Limitations: audio isn't supported and errors aren't checked at all. No seeking.

I tested it with one simple avs script with all colorspaces (YV12, YUY2, RGB24, RGB32). I'm sure you'll give it much better testing
Reply With Quote
  #23  
05-12-2004, 05:58 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
This is gerat, Milan! I can't wait to test it.
Reply With Quote
  #24  
05-12-2004, 06:01 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
thank you so much milan! will try it out tonight!

question: is this build optimized for a certain CPU type yet?
__________________
j3llyG0053
Reply With Quote
  #25  
05-12-2004, 06:07 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I compiled it on P4, without any arguments to ./configure. I don't know mplayer build process much and I'm not sure if resulting binary can be used on older CPUs.
Reply With Quote
  #26  
05-12-2004, 06:17 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
milan
I'm at work now, and tonight on duty. But tomorrow I'll run and test it.
What about speed?, does it slow down as using makeAVIS?
You da'man
Reply With Quote
  #27  
05-12-2004, 06:24 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I've never used makeAVIS with mencoder so I can't tell (actually only recently I learned that this combination is possible), but I guess it should be faster.
Reply With Quote
  #28  
05-12-2004, 07:27 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
hi milan.
your mencoder build crashes whenever I start it on my Athlon XP. Do you want me to post the windows error log? (it's long...)
__________________
j3llyG0053
Reply With Quote
  #29  
05-12-2004, 07:32 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Output from

mencoder.exe -v -v xx.avs ....

would be helpful.

It's quite possible, that this build requires SSE2.
Reply With Quote
  #30  
05-12-2004, 08:01 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
hmmm how do I save the output. there's no crash using these arguments, however the window is closed quite fast.
I could read something like "head_check failed". Sorry for being no big help on this issue.
__________________
j3llyG0053
Reply With Quote
  #31  
05-12-2004, 08:06 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by milan
I compiled it on P4, without any arguments to ./configure. I don't know mplayer build process much and I'm not sure if resulting binary can be used on older CPUs.
This won't work in any other CPU but P4. Not even AtlhonXP will work because it doesn't have SSE2.
Could please release the sources or reconfigure with:
Code:
./configure --enable-largefiles --enable-static --confdir=mplayer/ --enable-win32 --enable-runtime-cpudetection
The --enable-runtime-cpudetection allows it to run in any CPU, detecting at runtime. It's a bit slower than a CPU specific version, of course.
--enable-win32 enables the use of win32 decoders, you ca ndrop this if it causes problems.
--enable-static ensures that that you only need cygwin1.dll (and no other DLL) if you're using cygwin to compile
--enable-largefiles adds support to files greater than 2 Gb.

Thanks!
Reply With Quote
  #32  
05-12-2004, 08:08 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Jellygoose
hmmm how do I save the output. there's no crash using these arguments, however the window is closed quite fast.
Try mencoder.exe -v -v xx.avs [rest of your arguments] > crash.log

The file crash.log should display what happened.

-kwag
Reply With Quote
  #33  
05-12-2004, 09:17 AM
yaz yaz is offline
Free Member
 
Join Date: Aug 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Jellygoose
hmmm how do I save the output. there's no crash using these arguments, however the window is closed quite fast.
I could read something like "head_check failed". Sorry for being no big help on this issue.
you're just kidding, aren't you ?
wrap your command into a .bat & put a 'pause' at the very and. maybe, it helps (some screen output can't be redirected, anyway)
the bests
y
Reply With Quote
  #34  
05-12-2004, 10:37 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
it's been a long time since working with DOS. Thanks kwag and yaz...
__________________
j3llyG0053
Reply With Quote
  #35  
05-12-2004, 02:08 PM
Abond Abond is offline
Free Member
 
Join Date: Mar 2003
Posts: 243
Thanks: 0
Thanked 0 Times in 0 Posts
Maybe first report. P4, 1.6 GHZ XP Home. Using directly MencodeMe give multiple "duplicate 1 frame(s)!" errors - file size is 0 KB. Runing the same from CLI give the same. I tried to put ConvertToYUY2() at the end of script (I don't know why I thought it will cure) and the error gone, but it shows every time (99%) Stoped it. Every attempt to repeat it gave me this duplicate frame error - as the encoder received only the first frame and discard it when received again (I think) The script included RemoveDirt and HybridFupp (704,576, preset="very high"). Aim - 1/3 DVD (file size).
Reply With Quote
  #36  
05-12-2004, 02:40 PM
rds_correia rds_correia is offline
Free Member
 
Join Date: Apr 2003
Location: Chinese Democracy starts now!
Posts: 2,563
Thanks: 1
Thanked 0 Times in 0 Posts
Hi Milan,
It's always great to see you around
If you can show us how to include the avs support we'll provide the compilations here at the forum and we will be forever gratefull
Not to mention that each one of us will buy you a pack of beer so you can do it like we do while we wait for our encodings are finished
Thanks buddy.
Cheers
__________________
Rui
Reply With Quote
  #37  
05-13-2004, 06:33 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I compiled mplayer/mencoder using suggested configure options and updated http://ffdshow.sf.net/mencoderAVS.rar.

@Abond
Please could you send me that avisynth script and mencoder command line used? As I wrote before, I tested mencoderAVS with very simple avs file and libavcodec's mpeg4 codec.

@rds_correia
I'll release sources soon, but first I'd like to wait for Abond's answer.
Reply With Quote
  #38  
05-13-2004, 07:31 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Milan,

I just tested with this script:
Code:
Avisource("D:\Videos\mymovie.avi",false)
WIDESCREEN=0
Overscan=0
AssumeFPS(23.976)
WIDTH=352
HEIGHT=480
function AddAudio(clip v1) {
v2 = Blankclip()
v1 = AudioDub(v1,v2)
return v1
} 
Function DivXResize(clip c, int WIDTH, int HEIGHT, int OVERSCAN, string RESIZER, int widescreen) {
ratio=((c.width()+.0)/(c.height()+.0))+.0
halfheight43=(round(c.width()/1.33333)-c.height())/2
halfheight43=(widescreen==1)&&(ratio>1.7777) ? (round(c.width()/1.77777)-c.height())/2 : halfheight43


#Crop to fullscreen it this has been asked
fullscreen_cropper=round ((c.width()-(c.height()*1.33333) ) /2)
f_c_mod=fullscreen_cropper % 2
fullscreen_cropper=( f_c_mod == 1) ? (fullscreen_cropper+1) : fullscreen_cropper
c= (widescreen == 2) ? c.crop(fullscreen_cropper,0,(c.width()-2*fullscreen_cropper),0): c

#What would be the height keeping the aspect ratio if width was 640/320-NTSC or 768/384-PAL(4:3)
no_borders_height1=c.height()
#4:3 (option 0 and 2)
no_borders_height1=(HEIGHT == 480) ? (640*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 240) ? (320*c.height())/(c.width()) : no_borders_height1

no_borders_height1=(HEIGHT == 576) ? (768*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 288) ? (384*c.height())/(c.width()) : no_borders_height1

#anamorphic (option 1)
no_borders_height1=(HEIGHT == 480)&&(widescreen==1)&&(ratio>1.7777) ? (848*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 240)&&(widescreen==1)&&(ratio>1.7777) ? (424*c.height())/(c.width()) : no_borders_height1

no_borders_height1=(HEIGHT == 576)&&(widescreen==1)&&(ratio>1.7777) ? (1024*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 288)&&(widescreen==1)&&(ratio>1.7777) ? (512*c.height())/(c.width()) : no_borders_height1


#Now how much we have to shrink to make it fit inside a macroblock?
mod16height=no_borders_height1 % 16

#If the rest is <=8, subtracts the rest, else, completes to 16.
completion= (mod16height <= 8) ? (-mod16height) : (16-mod16height)
no_borders_height2=no_borders_height1+completion

#finally resize
c=Eval( RESIZER + "(c," +  string(WIDTH) + "," + string(no_borders_height2) + ")" )

#add lateral overscan
c=letterbox(c,0,0,overscan*8,overscan*8)
return(c)
}

Function DivXBorders(clip c, int HEIGHT, int OVERSCAN) {
halfheight43=(HEIGHT-c.height())/2
c=addborders(c,0,halfheight43,0,halfheight43)
#Add vertical overscan
c=letterbox(c,overscan*8,overscan*8,overscan*8,overscan*8)
return(c)
}

converttoyv12()
BlindPP(cpu=4)
Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.1,seed=1)
Convolution3D(1, 6, 12, 6, 8, 2.8, 0)
DivXResize(WIDTH, HEIGHT, 0, "LanczosResize",WIDESCREEN)
Undot()
TemporalSoften(2,7,7,3,2)
DCTFilter(1,1,1,1,1,1,0.5,0)
#Blockbuster(method="noise",detail_min=1,detail_max=10,variance=0.3,seed=5623)
DivXBorders(HEIGHT,OVERSCAN)
converttoyuy2()
AddAudio()
MonitorFilter


sampler(length=15)
And it worked fine, only crashed in the end. I did 2 passes, both crashed in the end.
My include file:
Code:
of=rawvideo=1
ovc=lavc=1
nosound=1
sws=2
lavcopts=vcodec=mpeg2video:vrc_eq=tex:vmax_b_frames=2:
vrc_maxrate=2500:aspect=1.3333:keyint=24:vrc_buf_size=917:preme=2:precmp=2:vstrict=-1:autoaspect=1:
scplx_mask=0.3:vqblur=0:mbqmin=1:vqmin=1:mbqmin=1:lmin=1:
intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,
29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,
37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
:inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,
26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,
30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44
ofps=23.976
And my command-line:
Code:
D:\Temp\mencodeme>Mencoder.exe -include temp.conf -lavcopts vbitrate=977:vpass=2 "D:\Temp\video\Movie0.avs" -o "D:\Temp\video\Movie0a.mpv"
The resulting encoded file is also fine.
Reply With Quote
  #39  
05-13-2004, 08:17 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
After downloading 6 missing filters, I was able to test your script with same result as you: output file seemed to be OK, but mencoder crashed on exit. I'm just guessing what could cause this. For me it reports error in xvidVFW.dll, but I'm not sure if it's really crashing there. Please try some huffYUV source, this didn't crash for me.

And as I wrote before, I don't know how to release AVS_ScriptEnvironment variable. So even if this doesn't causes crash, it'd still cause resources leak.

BTW I implemented seeking support in demux_avisynth.
Reply With Quote
  #40  
05-13-2004, 10:58 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by milan
Please try some huffYUV source, this didn't crash for me.
I tried with the initial build and it didn't crash. I'll do another test later, right now I am in a hurry.
Quote:
BTW I implemented seeking support in demux_avisynth.
Cool!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie guide for Mencoder with Avisynth support rds_correia Video Encoding and Conversion 44 05-02-2004 05:07 PM
FFMPEG: Do ffvfw and mencoder/ffmpeg give the same results? Razorblade2000 Video Encoding and Conversion 4 02-06-2004 04:23 PM
FFMPEG: Mencoder/ffmpeg aspect-ratio tetra Video Encoding and Conversion 10 12-11-2003 11:19 AM
FFMPEG: [FAQ] AC3 Support Razorblade2000 Video Encoding and Conversion 0 09-13-2003 06:21 AM
FFMPEG: What will/does Japie ffmpeg support? ak47 Video Encoding and Conversion 1 09-06-2003 07:21 AM

Thread Tools



 
All times are GMT -5. The time now is 07:20 AM  —  vBulletin © Jelsoft Enterprises Ltd