Quantcast Mencoder: FFmpeg with Avisynth Support - digitalFAQ.com Forums [Archives]
  #1  
05-05-2004, 03:04 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

yesterday I tried to add Avisynth script support to ffmpeg/ffplay using Avisynth C interface. You can download compiled ffmpeg from http://ffdshow.sf.net/ffmpeg_avs.rar.

It's a first "draft" and has many bugs and limitations, including:

- crashes on exit - I guess it's because AVS_ScriptEnvironment isn't freed (I didn't found any function in avisynth C interface to do this)
- only video is supported
- no seeking
- no error handling
- I had problem implementing timestamps, but maybe it's OK now

If this would work, I'll make sources available and someone could compile mencoder using this modified libavformat.

[/url]
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
  #2  
05-05-2004, 03:44 AM
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 ,
Welcome buddy .
We've been waiting for you for months
We've been trying to understand ffvfw/ffdshow usage and we really needed your help.
Anyway, we're now a bit more concentrated on Mencoder and I am very to see that you are willing to help us on Mencoder's ability to open avs scripts.
I'm sure other members will to compile it the way you just explained.
Hope to keep hearing from you now and then :P .
Cheers
__________________
Rui
Reply With Quote
  #3  
05-05-2004, 04:28 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
Hi Milan,
wellcome. Nice to see you visiting us.
It's good having people like you improving this ffmpeg thing.
Thanx

EDIT: VM or rds or Inc: as you're more used to compile mencoder, you could try as Milan advises, with this new ffmpeg, and we could test and help with debugging... well, if you have time, friends
Reply With Quote
  #4  
05-05-2004, 04:51 AM
Hydeus Hydeus is offline
Free Member
 
Join Date: Dec 2003
Location: Omicron Persei 8
Posts: 322
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Milan.
1st post, and what a superb entry
Small problem: I can't force this to work in any way
The procedure entry point_avs_create_script_environment@4 could not be located in dynamic link avisynth_c.dll
I have avisynth_c.dll in ffmpeg and %systemroot% folders but it doesn't working. Any guides
__________________
Go for SECAM =)
Reply With Quote
  #5  
05-05-2004, 05:17 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
as kwag would say: The future looks bright!

Welcome on board milan! If Mencoder would accept AVS scripts natively, it would be a great improvement! I'm not that smart, but wouldn't it actually be a gain in speed too, since the way we do it now with the avi-container slows things down a bit doesn't it?
__________________
j3llyG0053
Reply With Quote
  #6  
05-05-2004, 06:41 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
FIRST: Milan, a big welcome to you in here! Wo do apriciate your presence more than very much!!

Second: @ Jell'

If you do convert direct from VOB to m2v/m1v and using sources like DVDs which are often well mastered (I said "often" so not all ).
Mencoder and its internal routines filters do have a very big potential so in a an easy encoding way that would be enough.

BUT ... in very tricky cases like if you do deal with PAL DVDs/captures where these have been just telecined from 23.976 to 29.97 and then for the PAL market direct "norm-converted" to 25fps (no IVTC first before! YEP, thats often done!).... this would need a complex scripting in avisynth, containing ways which are not possible in mencoders internal filters.
I do only say "StarTrek next generation", "Voyager", "Simpsons", "Futurama" etc. the functions like restore24() or unblendpattern() are the only way to get these streams back to their real 23.976 WITHOUT still existing blendings in frames.

Also ... our MA script. You cant perform an IF YdifferenceToNext() ... adaptive "routine" by using mencoders internal possibilities only.
Filtering of Mencoder is static and thats the point where Avisynth still gives much of gain for higher standard video encoding routines.

Inc.
Reply With Quote
  #7  
05-05-2004, 08:40 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Welcome to the forum Milan!


I can't wait to try this. It should also work with mencoder, because when compiling, we only copy the libavcodec and libavformat to mplayer folder. Well, we never know, but should work. Then you can submit the patch to mplayer-dev mailing list, I'm sure they will approve (with a few #defines to only compile with avisynth support in Windows)

Anyway, congratulations for the idea.

@Hydeuos
This looks like you're using an old DLL, try to use the latest version.

EDIT: This thread is related to ffmpeg, I'll move it to the correct forum.
Reply With Quote
  #8  
05-05-2004, 09:07 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
VM,
move there if needed to keep the forum organized...
but keep us informed here when working in mencoder
Reply With Quote
  #9  
05-05-2004, 10:51 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
I'm late
Welcome Milan

-kwag
Reply With Quote
  #10  
05-05-2004, 10:15 PM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Milan,

It always feezes when encoding in frame 48 or 51 with me. I did a batch file and adapted the optimized settings used in mencoder in case anyone wants to try

Code:
rem ####################
rem ## Configuration ###
rem ####################
SET MAX_BITRATE=2500
SET GOP=24
SET VBV=2000
SET BITRATE=1500
SET INPUT=carro-proc.avs
SET OUTPUT=santana-ff.mpg

ffmpeg.exe -an -vcodec mpeg2video -b %BITRATE% -aspect 1.3333 -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 -maxrate %MAX_BITRATE% -rc_eq tex -bufsize %VBV% -g %GOP% -lmin 1 -mbqmin 1 -qmin 1 -preme 2 -precmp 2 -scplx_mask 0.3 -qblur 0 -i %INPUT% %OUTPUT%
( the ffmpeg line must be one line only, without brakes!)

Just to make it clear, it freezes with and without this settings, and I used a script with avisource only ( tested with some huffy captures).

Let me know if you need any specific test.
Reply With Quote
  #11  
05-06-2004, 02:17 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
First, I'd like to thank you for all the welcomes.

I posted to mencoder/avisynth thread because adding avisynth support to ffmpeg is for me just intermediate step in process of adding avisynth support to mencoder. I could modify mencoder directly, but I haven't compiled mplayer in windows yet, only ffmpeg.

@vmesquita:

I tried your example with two results:
1. I can confirm the problem with non-integer framerates - I'll investigate it further
2. When using HuffYUV source, ffmpeg didn't crash at exit.
Reply With Quote
  #12  
05-06-2004, 02:35 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I uploaded new ffmpeg_avs.rar. Please try it, freeze when encoding should be fixed now.
Reply With Quote
  #13  
05-06-2004, 06:30 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,

Problem fixed! It really was only happening with non-integer frame-rates even with 29.97, but now it's working great.
I was testing a huffy source and like you it doesn't crash.

About mencoder: I don't think you need to add support to mencoder directly: when you compile mencoder, you just need to copy libavcodec and libavformat to mplayer folder. From what I understand you just added a new input type to libavformat, it may be working with mencoder already. If possible, make the sources available so I can compile. I can't wait to see this working on mencoder.
Reply With Quote
  #14  
05-06-2004, 07:47 AM
milan milan is offline
Free Member
 
Join Date: Mar 2004
Location: Slovakia
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I'm glad it's working now.

I tried to build mencoder using mingw with modified libavformat. However resulting mencoder stopped before encoding first frame. I'll investigate this later, because today I'd like to work on ffdshow too (I'd like to finally correctly implement MPEG1/2 decoding).
Reply With Quote
  #15  
05-06-2004, 07:59 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Great Milan! Let me know if you need any help.
Reply With Quote
  #16  
05-06-2004, 10:36 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
Hey guys,
we're all in Mencoder and MencodeMe forum how great it is the advances done to work with avisynth from inside ffmpeg(/mencoder).
Thanx for your work
Reply With Quote
  #17  
05-07-2004, 06:02 AM
Hydeus Hydeus is offline
Free Member
 
Join Date: Dec 2003
Location: Omicron Persei 8
Posts: 322
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by vmesquita
This looks like you're using an old DLL, try to use the latest version.
I'm using Kevin Atkinson 01-Jan-2004 21:31 build. Still no results
__________________
Go for SECAM =)
Reply With Quote
  #18  
05-07-2004, 06:44 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
Oh man!
I just can't wait to see mplayer/mencoder reading avs scripts natively
Hope I could help you guys but I'm not the "brains" in the family
Just let us know when you have something for testing.
Cheers
__________________
Rui
Reply With Quote
  #19  
05-09-2004, 06:59 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
Hmmm, four days since first milan post. No news about ffmpeg-avisynth (-mencoder)... no news is bad news?
Reply With Quote
  #20  
05-09-2004, 09:22 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
@Hydeus
Try putting the DLL in avisynth plugin folder (not in script folder). It solced the problem for me.

@digitall.doc
He's probably busy, let's wait and let him surprise us.
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 05:29 AM  —  vBulletin © Jelsoft Enterprises Ltd