Esato

Forum > Sony Ericsson / Sony > Themes, ringtones, screensavers, games, video clips > Official K800/790 Video Thread

Previous  123 ... 161718 ... 232425  Next
Author Official K800/790 Video Thread
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-23 02:52
Reply with quoteEdit/Delete This PostPrint this post
Hey Mysh

thank you for your feedback!

I know we are always asking for requests and it's not fair to ask to much but how easy would it be to add .mpg/.avi AC3 support? (for people who already have video files with this audio format)

There is an opensource AC3 coder/decoder here if this helps!?
http://fcchandler.home.comcast.net/

PS: If it's not feasible don't worry.
_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-23 01:58 ]
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-23 04:55
Reply with quoteEdit/Delete This PostPrint this post
i don't think you can get mpeg files with ac3 soundtracks?

vob files containing mpeg video have ac3 soundtracks, but vob files with ac3 are already supported by M3.

avi files with ac3 audio are also supported, providing you can play the avi file on your computer. What that means is you need some kind of ac3 codec installed.

i personally use m3 to convert a number of avi files with ac3 audio, so i know it does work.

if you've got a problem with an avi containing ac3 audio, ie. it fails to convert in m3, email me the lastrun.log.

I could easily change the avi-with-ac3 decoding method if you find there is a problem.

[ This Message was edited by: mysh on 2006-10-23 03:57 ]
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-23 14:25
Reply with quoteEdit/Delete This PostPrint this post
Would you like me to send you one?

EDIT: update mailed you an small mpg AC3 file to try


[ This Message was edited by: dcuk on 2006-10-23 13:53 ]
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-23 23:28
Reply with quoteEdit/Delete This PostPrint this post
Thanks for the file dcuk.

After checking it out, it seems your mpg file -was- a vob file taken straight from a dvd, and renamed to mpg to make it play in windows media player.

The easiest fix for that is to name it back to .vob instead.

But as some renamed vob mpeg streams may be on readonly storage (can't rename unless you copy it), i've added code to detect pseudo-vob files named as mpg/mpeg/dat and treat them as vob files without renaming them (ac3 audio decoding and also more importantly DAR/PAR aspect correction).
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-24 00:41
Reply with quoteEdit/Delete This PostPrint this post
Thanks Mysh

The clip was from my dvd ripped using DVDFabDecrypter then imported the vob into VideoReDo-Plus to select just the part I wanted to send to you so saved out as an mpg

I guess ViedoReDo will be just renaming the vob section (hadn't thought of that, thanks) as it only encodes extra I-frames at cuts to create keyframes and no other actual 'video' encoding is done

///////////////////////////////////////////////////////////////////////////
Very interested to here about your work so far on PAR & DAR cropping

I've been working for hours, well actually last few days lol to correct my own PAL Anamorphic movie to K800i 320x240 4:3 cropping algorithm and think I've finally cracked it!
(there's lot of articles on the net to go 4:3 to 16:9 but not the other way round)

*** here it is in case it's helpful in some way.***
720x576 (16:9)-> cropped to smaller(4:3)= y1+y2*2.04/2=cropping size x1 & x2

The user only has to manually crop the blackbars at the top & bottom, the left and right is cropped automatically to keep correct aspect for the K800i

If you need my 720x576 (non-anamorphic) to 320x240 4:3 please let me know,


I might be behind in where you are at but thought I'd try and help with M3 in some small way.


_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-24 00:11 ]
jj03
T68 gold
Joined: Oct 29, 2002
Posts: > 500
PM
Posted: 2006-10-24 00:47
Reply with quoteEdit/Delete This PostPrint this post
found out that the max framrate for the n73 is 15 fps...surely that can't be right...quite disappointed. anyway...hopefully mysh's adjustments to m3 will help me out video wise.
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-24 01:40
Reply with quoteEdit/Delete This PostPrint this post
hey dcuk,

Interesting to see you've been looking at DAR correction too... any reason?

I had to develop DAR correction once i added vob support to m3 a while ago, and then tweak it a bit more once i added full DVD ripping.

I'm trying to follow your formula there, it seems you're operating on cropping values either end of the picture (y1/2 and x1/2), but i found as 1 and 2 are always equal, it's easier to operate on total crop value then divide by two as the last step.

When m3 calculate cropping values for DVDs or vobs, it does it in stages. First thing to deal with is the 4:3 PAR using a 16:9 DAR (display as non-square pixels), and m3 handles this by changing the PAR to 16:9 also. for example on a typical DVD...

PAR = 720x576
DAR = 16:9

resize the video pixel resolution to 16:9 using...

new y = (x / DAR-x) * DAR-y

in this case that's...

(720 / 16) * 9 = 405

changing PAR to 720x405, so now...

PAR = 720x405 = DAR = 16:9

Now the video is played with square pixels (DAR is applied at the pixel level), so it's like any other widescreen video.

At this point 4:3 cropping is done the same as any other video such as avi/mov/mp4 etc.

M3 has several widescreen modes, but in the case of cropping to 4:3 for fullscreen with no borders, the math is:

(y / 3) * 4 = new x

old x - new x = total cropping

crop per side = total cropping / 2

in the example that's....

(405 / 3) * 4 = 540

720 - 540 = 180

180 / 2 = 90

so crop 90 pixels from each side to get 4:3 fullscreen without distortions.

As a single line formula for widescreen to 4:3 cropping, you could express it as:

crop from each side = (ResX - ((ResY / 3) * 4)) / 2

i'm pretty sure i put it in those video tutorials i wrote.

Then resize to 320x240 of course. hehe.


jj03: 15fps does sound low, i'll look into n73 performance, but if it is only 15fps, that's what i'll add the profile as.


[ This Message was edited by: mysh on 2006-10-24 00:54 ]
jj03
T68 gold
Joined: Oct 29, 2002
Posts: > 500
PM
Posted: 2006-10-24 01:44
Reply with quoteEdit/Delete This PostPrint this post
thankyou mysh...very very much appreciated...oh..and please add a donate button soon...
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-24 01:52
Reply with quoteEdit/Delete This PostPrint this post
Thanks jj03, i will add the donate button soon... once things are working well enough that i won't feel bad accepting money for it!
jj03
T68 gold
Joined: Oct 29, 2002
Posts: > 500
PM
Posted: 2006-10-24 02:01
Reply with quoteEdit/Delete This PostPrint this post
well, i'll tell ya..i'm using SUPER! at the mo...and it just don't feel right...i'm so used to m3...
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-24 02:04
Reply with quoteEdit/Delete This PostPrint this post
Hey Mysh

I've been working on it awhile trying to perfect it (ok readers you can stop laughing now! lol ) and thought it might be helpful for M3 in some way,

I understand y1 & y2 should be equal and started out that way but then thought maybe a user might want to crop a DOG from there video and in so doing would have uneven y1 & y2 settings but didn't want them to have to worry about maintaining DAR by guessing x1, x2


Did you manage to get chance to change your PAR to 1.2222 from 1.3333 so M3 will produce correct circles? (looking forward to not having to go through virtualdub first!)

Thank you.

*******************UPDATE************************

PS: after just trying "(y / 3) * 4 = new x" this will work fine if final output is for TV but not for 320x240

as a test using (576 / 3) * 4 = 768 (which is how a CRT displays a 720x576 to correct it's DAR, but doing that with a cropped image and using this calculation it will add distortion as there's no final overscan calculation produced on the output medium in this case the K800i

(I could be completely wrong here too )
_________________
Hope this helps!
Cheers,
Dcuk


[ This Message was edited by: dcuk on 2006-10-24 01:48 ]
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-24 02:22
Reply with quoteEdit/Delete This PostPrint this post
Nobody has asked for uneven cropping yet, so i haven't looked at it. It seems an unlikely thing to need.

How come you have been working on crop calculation tho? working on some software?

I haven't gotten around to supporting PAR below 1.33 yet, it'll be easy to add tho. Until i came to reply to your post, i hadn't even looked at the cropping code for about 2 months! It's more than a little untidy, you can even see where i've reduced the target aspect ratio from 4 / 3 to 0.75 in some places but not others, terrible really:

Code:

Sub ComputeCrops()
'compute 16:10 > 4:3 aspect horizontal cropping value
iCropH = Convert.ToInt32((iSourceWidth - ((iSourceHeight / 3) * 4)) / 2)
'vob version
If strFileExtension = ".vob" Or bIsDVD = True Then
iCropH = Convert.ToInt32((iSourceWidth - ...
(((iSourceWidth / fSourceAspect) / 3) * 4)) / 2)
End If
If iCropH Mod 2 = 1 Then
iCropH = iCropH - 1
End If
'assign cropping value so long as it's positive value
If iCropH < 0 Then iCropH = 0
'compute letterbox removal
iCropVl = Convert.ToInt32((iSourceHeight - (iSourceHeight * 0.75)) / 2)
'vob version
If strFileExtension = ".vob" Or bIsDVD = True Then
Dim newsourceheight As Integer = CInt(iSourceWidth / fSourceAspect)
If Not newsourceheight Mod 2 = 0 Then newsourceheight = newsourceheight - 1
iCropVl = Convert.ToInt32((newsourceheight - (newsourceheight * 0.75)) / 2)
End If
iCropHl = Convert.ToInt32(iCropH + iCropVl)
If iCropHl Mod 2 = 1 Then
iCropHl = iCropHl - 1
End If
If iCropHl < 0 Then iCropHl = 0
If iCropVl Mod 2 = 1 Then
iCropVl = iCropVl - 1
End If
If iCropVl < 0 Then iCropVl = 0
End Sub



lines starting with ' are just comments.

as you can see, aspect ratios wider than 4:3 are considered (eg. 16:10), but i never looked at aspect ratios narrower than 4:3 such as 5:4.

I'll overhaul that code before the next release and make it use the detected par in all cases (5:4, 16:9 etc).

[ This Message was edited by: mysh on 2006-10-24 01:51 ]
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-24 02:43
Reply with quoteEdit/Delete This PostPrint this post
I just updated my last post above

you are using 0.75

I was using 0.77 (Don't ask ) but then found 0.67 to be more accurate if you are referring to converting anamorphic, even had a string of y*1.2222*0.67=x until I found using 2.04 produced to same results (well it does for me)


Just a quick PS: please can you shorten the length of your _____ line in above post so forum goes back to normal width, thank you

PPS: you never know someone else might want uneven borders I've needed them in the past!

_________________
Hope this helps!
Cheers,
Dcuk


[ This Message was edited by: dcuk on 2006-10-24 01:54 ]
mysh
K800 Black
Joined: Dec 04, 2005
Posts: 176
PM
Posted: 2006-10-24 03:23
Reply with quoteEdit/Delete This PostPrint this post
edited it to shrink it a little, if you like i'll just remove the code. I thought if you were writing some code yourself it might prove handy.

PAL TV is 1.25 (5:4) ratio. I get what you mean about it being wrong on the phone screen, which is 1.33 (4:3). Basically the TV does it's own 4:3 DAR on the 5:4 PAR tv signal. See below on 'narrowscreen' video about this.

essentially i am using a value of 0.75 because that is the target screen ratio of height to width, 3/4 = 0.75.

so for ANY widescreen video with a ratio of anything above 1.33 (4:3), you take the height, and multiply it by 0.75 to find out what the new width should be to make it proportionally perfect on a 4:3 screen. Does that makes sense?

In the case of PAL signal tv captures, it's a 'narrowscreen' video, so you need to do the opposite... 720/576 = 5/4 = 1.25 aspect. You crop a tiny amount off the top and bottom (instead of the sides) to fit to 4:3 fullscreen, yet keep perfect proportions (perfect circles).

The actual math would be:

crop from top and bottom = (Res Y - (ResX * 0.75)) / 2



i understand you're using 0.77 then 0.67 to account for overscan and the TVs own DAR, but this isn't neccessary, as a TV overscans in both X and Y dimensions. 0.75 is the phone aspect, which is what we're targetting, it's perfect. The cropping is like only doing the vertical part of the TV overscan, it's not to replicate the TV overscan tho, it's to fix the PAR.

Really i should just change the * 0.75 to / 1.33, it's the same thing, and would make this a lot less confusing to read!

trying to combine both the target aspect and source aspect into one value like 2.02 works fine if your source aspect is always the same. But only then. It's better to compute source aspect on-the-fly, with a simple rule to distinguish between the two cases of < 1.33 or > 1.33 aspect.

That way you can deal with video of any proportions accurately and easily.

In that earlier post i mentioned i'll add support for aspect's below 1.33, and what i meant was adding that vertical crop for 'narrowscreen' 5:4 captured video, and any other video under 1.33 aspect.

I should admit, i don't specifically know how exactly a TV converts the 5:4 signal to a DAR of 4:3, it may use non-square pixels in the CRT. I am aware that overscan occurs horizontally as well as vertically though.


[ This Message was edited by: mysh on 2006-10-24 02:33 ]
dcuk
K800 Black
Joined: Jun 28, 2005
Posts: 121
PM
Posted: 2006-10-24 03:58
Reply with quoteEdit/Delete This PostPrint this post
720x576 is 1.2222 because 8 pixels either side normally arn't used in almost all DTV broadcasts (I read a complex article on it months ago explaining why they do this, I'll try and find it for you later on today)

Have a peep at the frame grabs I posted before to help explain
http://www.esato.com/board/viewtopic.php?topic=125517&start=180

I used to use 1.25 on the k750i as the media player adds tiny black borders top and bottom to 128x96 video as it can't quite stretch it to fill the frame so 1.25 produced true circles on screen

I've tested lots and lots of videos (honestly!) and really 1.2222 seems to look perfect on the k800i screen (I've even paused videos and mesured circles both ways to see how round they are (sad I know lol)),

infact I'll encode some small files size videos in the different DAR's so you can try them on your phone

_________________
Hope this helps!
Cheers,
Dcuk

[ This Message was edited by: dcuk on 2006-10-24 03:07 ]
Access the forum with a mobile phone via esato.mobi
Previous  123 ... 161718 ... 232425  Next
Goto page:
Lock this Topic Move this Topic Delete this Topic