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 > Announcements and Chat > General Discussion

Reply
 
Thread Tools Display Modes
Old 17th September 2005, 15:56   #1  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
PSPEnc, ffmpeg gui for PSP encoding (mpeg4 sp only)

You can find it here:

http://jonny.leffe.dnsalias.com

PSPEnc is a gui for FFMPEG. It uses Avisynth to handle the video. The output is an mp4 file compatible with PSP (only MPEG4 SP atm).

Features:
- Avs, Avi, Mkv, Ogm, Mpg, Wmv ... input (basically everything working with DirectShowSource).
- Automatic crop/addborders, to obtain correct aspect ratio.
- Automatic video bitrate calculation (you have to choose only audio bitrate and total output size).
- 1 pass, 2 pass, 1 pass with fixed quantizer, compressibility test, size prediction for fixed quantizer encodes.
- Job list.
- You can see quantizer distribution after every encode.
- You can run multiple istances of PSPEnc.

Notes:
- To encode from DVD source you should provide an avs script with progressive, cropped video and specify the correct aspect ratio (usually i do this with GKnot ^^).
- Compressibility test is based on the quantizer you specify (it basically tell you how near/far you are from this quant).
- If you obtain an output with wrong size (this is applicable mainly for 2 pass encodes), you have probably saturated video (and/or audio!).

no avc support atm ... ( until someone send me a psp with fw 2.0 for free )

bye
jonny
__________________
home sweet home

Last edited by jonny; 8th October 2005 at 23:33.
jonny is offline   Reply With Quote
Old 17th September 2005, 17:31   #2  |  Link
guada2
Registered User
 
Join Date: Jun 2005
Location: Lyon
Posts: 190
Happy to see you here.

guada2 is offline   Reply With Quote
Old 17th September 2005, 22:44   #3  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
@jonny

I've downloaded it and so I tested it out! It works like a charm and I did like a lot of prediction for quantizer encoding. My interest in it should be adapt it for encode to PALM's handheld. Could you give some advises to me about this target encoding? Keep up the good work!

TIA,
danpos is offline   Reply With Quote
Old 18th September 2005, 10:18   #4  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
thanks to both

danpos, do you want to know the details of the size prediction (or general infos for PALM encoding)?
__________________
home sweet home
jonny is offline   Reply With Quote
Old 18th September 2005, 21:36   #5  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
@jonny

Thanks for your interest in my questions. Both if possible! And if possible (again) I'll like to know more about your resize scheme.

Thanks in advance.

Cya!
danpos is offline   Reply With Quote
Old 19th September 2005, 11:28   #6  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
Size prediction:

First of all, AviSynth is required in the process.
To make a prediction from, for example, a .avi file, a script like this is used:

DirectShowSource("myvideo.avi")
SelectRangeEvery(1400, 14)

This means that 14 frames every 1400 will be returned from the original file (this is the 1% case).

Now, you pass the script to your encoding app (in this case FFMPEG) making a normal fixed quant encode.

To predict the final size, you must find a way to read frame size for every encoded frame (-vstats option is the way for FFMPEG - it creates a log file with the infos needed).

So:

Reading the log you have the size for each frame encoded.
Summing up the frame sizes (discarding some frames) and dividing this sum by the number of frames used, you have the average frame size.
Multiply the average frame size by the total number of frames and you have the predicted size.


About "discarding some frames":

SelectRangeEvery(1400, 14)

Using this istruction, we take the first 14 frames, than we jump to the next 14 frames skipping 1400-14 frames.
This jumps cause the codec to thing that there is a scene change, so a keyframe is inserted (artificial, because in your normal encode you'll never have this keyframe)
Keyframes take more space compared to normal delta frames, so, to make a good statistic you must discard those frames (if not, you'll obtain a totally crazy result).

This means that the first frame every 14 frames is discarded from the output when i make the calculations.
(bframes enabled complicates things a bit, other frames needs to be discarded - it's not the case of a psp encode )


PS: in the examples i've used 14 (mainly cos i've copy/pasted from an old thread) PSPEnc uses 13 as base for the SelectRangeEvery.
(14 is more convenient when bframes are enabled)


An old thread:
http://forum.doom9.org/showthread.ph...1&page=1&pp=20
(drop the initial part)





PALM:

PSP is my first little device ... ^^'
you have to do your searchs, i know nothing about PALM devices :P




PSPEnc's resolution picker:

The resolution picker is a bit strange.
I copy paste from an email i've recently send:

Quote:
also, if I change the output resolution, it's telling me there is an aspect ratio error, and it's tellin me the aspect ratio is ~16/9 when it is in fact 1.3333 (192x144)
Quote:
There is a reason for this.

PSPs with firmware 1.5 (like mine) basically stretch the video always to fit the psp screen (so the AR is always 16/9 for every resolution you choose)

There are only 2 exceptions:

320x240 can be viewed in 4/3 or stretched to 16/9
160x112 can be viewed in ~ 4/3 or stretched to 16/9

So:
If you choose 320x240 and 16/9, you should watch the video in "fullscreen"
If you choose 320x240 and 4/3, you should watch the video in "original", "normal", or "zoom"
(the same goes for 160x112)

All the other resolution are always displayed 16/9, no matter of what PSP's setting you use ("original", "normal", or "zoom" or "fullscreen")

On firmware 2.0 i think the stuff is changed ... in this case you should always use "fullscreen" on PSP if you choose 16/9 for output.
In addition to this:

When you open a file, PSPEnc assumes square pixels (and so the input AR is calculated - you can change it if the input have a different AR).
To match the output AR, you usually have 2 choices: crop one side or add borders to the other side (so you can usually choose one of the 2 mode in order to get correct AR on output).
PSPEnc always goes for cropping by default (adding borders is probably useful only for widescreen content - AR = ~ 2.35)

EDIT:
Some resolutions are not selectable because the output show big artifacts when played on PSP (at least on fw 1.5).


i think i'll start making a faq with this post
__________________
home sweet home

Last edited by jonny; 19th September 2005 at 15:09.
jonny is offline   Reply With Quote
Old 19th September 2005, 15:52   #7  |  Link
danpos
BDVD Team
 
danpos's Avatar
 
Join Date: Dec 2004
Location: Rio de Janeiro - RJ/Brasil
Posts: 306
@jonny

WOW, what a great post you did mate !!

Surely the one clarified things up to me.

Keep up the good work.

Cya!
danpos is offline   Reply With Quote
Old 19th September 2005, 15:58   #8  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
i can do this type of posts only once per year

to you too
__________________
home sweet home
jonny is offline   Reply With Quote
Old 2nd October 2005, 17:18   #9  |  Link
gutzalpus
Registered User
 
Join Date: Jul 2004
Posts: 4
Any idea what would cause:

"Error: Exitcode=3"

as soon as I press the "Start all jobs" button? I installed the latest version of avisynth so I'm not sure what else would cause it.

EDIT: I installed the latest version of ffdshow and this corrected the problem.

Last edited by gutzalpus; 2nd October 2005 at 17:23.
gutzalpus is offline   Reply With Quote
Old 2nd October 2005, 18:02   #10  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
This kind of error is reported by ffmpeg (usually an exitcode != 0 means an error)
I've still not found a good way to get the exact error message
happy you solved with ffdshow, this could indicate a previous video or audio decoding problem

tip: if your source is an avi file, it could be more compatible to use "Method" = "AVISource" in the input panel (simply load the avi file and after press the "Change" button)
__________________
home sweet home
jonny is offline   Reply With Quote
Old 7th October 2005, 11:18   #11  |  Link
gutzalpus
Registered User
 
Join Date: Jul 2004
Posts: 4
I've also found that I get the same error whenever I try to convert a file with >2 channels of sound (xvid with 5.1 AC3, etc.)

So I have to manually demux and re-encode to stereo sound in order for pspenc to process the file. I'll try using "AVISource" and see if that makes a difference.
gutzalpus is offline   Reply With Quote
Old 7th October 2005, 11:42   #12  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
Quote:
Originally Posted by gutzalpus
I've also found that I get the same error whenever I try to convert a file with >2 channels of sound (xvid with 5.1 AC3, etc.)
Thanks for the report, i'll do some tests.
PS: i'm adding ffmpeg's error logging, in the next pspenc's version you'll be able to see the full error message instead of the exitcode number (hopefully you'll see no more errors ).
__________________
home sweet home
jonny is offline   Reply With Quote
Old 7th October 2005, 14:48   #13  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
I've done a quick test and ffmpeg seems to don't like audio with more than 2 channels, at least not in uncompressed pcm format (the way AviSynth output it).

Instead of demuxing, you could try to load directly the input file as "External audio", this should work.

EDIT: it works, at least with avi input (going to check more audio/container combinations)

EDIT2: a better solution is to play the video, open the audio filter properties, enable the ffdshow's mixer and select 2/0 - stereo output, this will work with every type of input.
__________________
home sweet home

Last edited by jonny; 9th October 2005 at 11:06.
jonny is offline   Reply With Quote
Old 10th October 2005, 22:33   #14  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
v1.01 is out

nothing big but better than 1.00

-------------------------

Changes:
- Added "Avi open", should be more compatible with avi input (use the generic open if this fails)
- "Add borders" is now the default method if the input aspect ratio is ~2.35
- FFMPEG's error logging (now you can see the exact FFMPEG's output after obtaining an "Exitcode" error)
- Added volume setting
- Added a check to see if AviSynth is installed
- Installer, with AviSynth and ffdshow included
- Maybe other things i don't remember :P
__________________
home sweet home

Last edited by jonny; 10th October 2005 at 23:27.
jonny is offline   Reply With Quote
Old 13th October 2005, 04:40   #15  |  Link
gutzalpus
Registered User
 
Join Date: Jul 2004
Posts: 4
jonny,

Thanks for all the great work on pspenc so far.

I have had success using the first method you suggest for multi-channel audio but in regards to the second, I haven't been able to locate the audio decoder options on ffdshow. Mine comes up with only video options.


Also, I occasionally run into some audio sync issues with pspenc encoded files. It isn't happening consistently and I haven't yet been able to isolate any particular settings which cause the problem.
gutzalpus is offline   Reply With Quote
Old 13th October 2005, 14:19   #16  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
strange, two icons should be on the tray (video and audio):

http://jonny.leffe.dnsalias.com/doom9/ff/ff00.png

Or, for example with Zoom Player, something like this should be possible (with a right click on video):

http://jonny.leffe.dnsalias.com/doom9/ff/ff01.png
(here you could see what is the audio decoder used)

If another decoder is used, this could indicate something wrong with ffdshow install (have you installed something audio/video related app after ffdshow?).


For the av synch probs - quite hard to get a cause, if you have some not copyrighted material and you want to send me it for testing, i'll be happy to check
__________________
home sweet home
jonny is offline   Reply With Quote
Old 16th October 2005, 15:56   #17  |  Link
Chris Benoit
Registered User
 
Join Date: Jun 2005
Posts: 122
I can't get PSPEnc to work.I run the mp4 generated files on my pc and i get the message rendering failes.I have klite and ffdshow install so i don't thing its a filter thing.
Chris Benoit is offline   Reply With Quote
Old 16th October 2005, 16:10   #18  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
use quicktime to play on pc

put the file in this way on psp to play it:
\MP_ROOT\100MNV01\M4V10001.MP4
__________________
home sweet home
jonny is offline   Reply With Quote
Old 16th October 2005, 16:47   #19  |  Link
Chris Benoit
Registered User
 
Join Date: Jun 2005
Posts: 122
Yep i knew about the psp folder since i've made conversions before,but quicktime being the only player that played the generated files strikes me as odd!

How come?I've made mp4 before with 3gp converter,nero recode and other soft and the play just fine in media player classic,y are these mp4 any different and play only with quicktime?
Chris Benoit is offline   Reply With Quote
Old 16th October 2005, 16:57   #20  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
i've not investigated too much about this (probably the answer is somewhere in the forum)
__________________
home sweet home
jonny is offline   Reply With Quote
Reply

Thread Tools
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 20:21.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.