Log in

View Full Version : 100% multi threading using PNG output folder


pancserzso
5th February 2012, 16:13
I have to make an exteremly slow encode which only runs at arond 0.25 fps. What I thought to make it faster without messing anything with MT versions of exotic plugins, I can just start 4 separate filtering threads to separate PNG files using ImageWriter. After that encoding should work very fast.

My problem is that so far I don't know how could I just play an avs script from frame A to frame B. Then the next task would be to write a python script or a batch file, which goes starts 4 threads with this command line player like:
- play 0-1000 wait till finish, play 4001-5000
- play 1001-2000 wait till finish, play 5001-6000
- play 2001-3000 wait till finish, play 6001-7000
- play 3001-4000 wait till finish, play 7001-8000
...

Do you know if there is a command line video player or a simple encoder with dummy output? At the moment I am experimenting with mplayer:

mplayer avsfile.avs -vc null -vo null -benchmark -nosound -ss 1234/24 -frames 1

^^^ But this doesn't work, as mplayer really has some bug with (http://muttley.hates-software.com/2006/02/21/5acc8f2b.html) -ss and frames parameter. I'll be looking into Media Player Classic or an AVS audio dumper which can support -startframe and -endframe. Any idea for such a program?

What I am looking for now is to how to make it into a batch or python script which starts at 4 threads, but first checking if the files doesn't exist already. Do you have any idea for this?

Also, how can I get a total frame number of an avs script in command line?

LoRd_MuldeR
5th February 2012, 17:08
My problem is that so far I don't know how could I just play an avs script from frame A to frame B

Use Trim() (http://avisynth.org/mediawiki/Trim) ;)

Do you know if there is a command line video player or a simple encoder with dummy output?

Use Avs2YUV (http://komisar.gin.by/tools/avs2yuv/) and, if you don't need the output, redirect its output to NUL.

avs2yuv.exe avsfile.avs - > NUL

pancserzso
5th February 2012, 17:09
Use Trim() (http://avisynth.org/mediawiki/Trim) ;)

Yes, after trying mplayer, ffmpeg, avs2avi, avsutil and media player classic I realized that the only way is to create temporary avs files with trim commands. I'll be doing this now.

LoRd_MuldeR
5th February 2012, 17:13
Well, maybe you can also do this with "-seek" and "-frames" options of Avs2YUV, but creating temporary AVS files shouldn't be a big deal either.

pancserzso
5th February 2012, 17:16
Well, maybe you can also do this with "-seek" and "-frames" options of Avs2YUV, but creating temporary AVS files shouldn't be a big deal either.

My problem with the temporary AVS files is that the numbering gets messed up if I use Trim before ImageWriter. On the other hand ImageWriter has some built in start and end functionality but it doesn't work, nor I understand how should it. I mean if I start playing a video at frame 0, then how would imagewriter (start=100, end=110) would do anything?

Update: OK, i get it. When using start and end, I have to seek to that region. So I am a the beginning.

pancserzso
5th February 2012, 17:20
avs2yuv works just perfectly! What ffmpeg, mplayer, avsutil, avs2avi and MPC-HC couldn't do works just perfectly from avs2yuv!

Gavino
5th February 2012, 17:58
the numbering gets messed up if I use Trim before ImageWriter.
Use Trim after ImageWriter and it will use the original frame numbers in the file names.