MoDaCo is undergoing planned maintenance. Site functionality may be reduced - follow @modaco or @paulobrien on Twitter for updates.

  • Announcements

    • Reminder - MoDaCo position on illegal content

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such software
      Nintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)


      CUSTOM ROMS

      You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not be hosted directly in topic via the MoDaCo attachment system
      ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)
      ROMs must give full credit to the original author
      This decision has been taken in light of the huge amount of interest in this area of device customisation within the community, and member feedback! Please note that custom ROM discussion should be kept in specific device sub-areas, (e.g. Kaiser.MoDaCo.com for Kaiser based devices). ISSUES If you have any issues with this policy, please contact me directly via PM. P
    • Support MoDaCo by signing up to a MoDaCo Silver or Gold membership

      To sign up to an annual MoDaCo Silver subscription which will eliminate all ads from the site (as well as giving you access to the MoDaCo Online Kitchens for Android) for only £9.99 using PayPal, Credit or Debit Card, ensure you are logged in to the site, and then click the link below, which will take you directly to the subscription store! You can also sign up to an annual MoDaCo Gold subscription for £29.99, which adds the benefits listed below! PURCHASE A MODACO SUBSCRIPTION - FREE Titanium Backup Mobile for Android worth $5.99! - FREE 1 year PrivateInternetAccess.com worth $39.95! - FREE 1 year LastPass Premium worth $12! - FREE CalcConvert for Pocket PC from Binaryfish worth $17.95! - FREE Calendar Bar for Pocket PC from OmegaOne worth $9.99! - FREE CamerAware for Pocket PC and Smartphone from MoDaCo worth £19.99 / $30! - FREE Chronos for Pocket PC from ActiveKitten worth $14.95! - FREE CodeWallet Pro for Smartphone and Pocket PC from DeveloperOne worth up to $24.95! - FREE Concentrix for Pocket PC from eSoft Interactive worth $9.95! - FREE FlexMail for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE FTouchSL for Pocket PC from Vekoff s.r.o. worth 10 euro / $12.50! - FREE Jewel Challenge for Pocket PC from eSoft Interactive worth $9.95! - FREE John Cody's Alerts Pro for Smartphone from Omnisoft worth $14.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Dutch for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> French for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> German for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Italian for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Spanish for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Dutch for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> French for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> German for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Russian for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Turkish for Smartphone from Lingvosoft worth $49.95! - FREE Note2Self for Pocket PC and Smartphone from WebIS worth up to $19.90! - FREE Opera 8.60 for Pocket PC and Smartphone from Opera Software worth up to $48! - FREE Pocket Informant for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE Pocket Launcher for Pocket PC and Smartphone from Conduits worth $9.95! - FREE PTab for Pocket PC and Smartphone from z4soft worth up to $60! - FREE Resco Explorer for Pocket PC and Smartphone from Resco worth up to $49.90! - FREE Safemode for Pocket PC from monocube worth $12.95 - FREE SplashPhoto for Pocket PC and Smartphone from SplashData worth up to $59.90! - FREE Sprite Backup for Pocket PC and Smartphone from Sprite Software worth $29.95! - FREE Teksoft Glyphs UI for Pocket PC and Smartphone from Teksoft €9.95! - FREE Teksoft HeadsetRemote for Pocket PC and Smartphone from Teksoft €4.95! - FREE Traffic Jam for Pocket PC from eSoft Interactive worth $9.95! - FREE unlock (1 per year) from imei-check.co.uk - DISCOUNT of 10% at MoDaCo FairDeal - DISCOUNT of 10% at Semsons.com - FORUM - AD FREE SITE - FORUM - custom rank / title - FORUM - double competition entries - FORUM - double post attachment space - FORUM - no search flood control - FORUM - priority event registration - FORUM - triple PM space
    • Reminder: Selling items on the forum directly is not allowed

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspensions / ban.
Sign in to follow this  
Followers 0

HTC Tornado Camera programming (directshow)

7 posts in this topic

Posted · Report post

I've been trying to overcome the limitation for which one cannot record video more than 176x144 in size, with the integrated camera app.

Windows mobile 2005 comes with intrinsic support for camera-enabled devices, and there are some samples in the respective SDKs that exploit these functionalities.

In the smartphone sdk, there's CeCamera that uses the integrated capture dialog to record video.

I can configure the size, and actually managed to record a 352x288 video, but the problem is that it does with very slow framerate, and the output video looks rugged, with strange vertical lines.

Also compression takes a lot.

In the pocketpc sdk, there's CameraCapture that uses a different approach: it uses DirectShow to read from the camera, simply opennig the device "CAM1:" on the phone.

After a little adaptation to the smartphone platform, i tested it on my SP5m.

This way, the capturing framerate is very high, almost 30fps I can say, but there weren't integrated options (in the program) to set the capturing size and the output was a 176x144 ASF file.

Compression takes forever, however.

Ther question is as follows:

The source device ins a DirectShow filter. CameraCapture, in its initialization code, sets its property "VCapName" to the value "CAM1:".

I couldn't find documentation regarding to these properties ANYWHERE...

There must be some properties dealing with capture size, or capture framerate, for example VCapSize or VCapFPS...

Does someone know??

The question evem is more broader as this is a DirectShow matter, and not of strict Smartphone programming...

Many thanks!!

enrico

0

Share this post


Link to post
Share on other sites

Posted · Report post

I've gone a bit further with the CameraCapture example, after a brief directshow tutorial.

I managed to get it streaming at 320x240, but the frame rate is uncontrollable... it reports it can do 7 to 15 FPS, but it always does 30 no matter what I set ;) (at 176x144 it did 60 FPS!!!!!)

I think this is a limitation of the htc camera driver.

Also I can't change nothing about the compression details... all methods return "Not Implemented".

The output isn't so bad, all in all, but the image coming from the camera (or perhaps from the HTC driver) is already saw-edged, and the compression has a strange effect of leaving white pixels all around when there are sharp borders in the image.

Also encoding takes a lot :P

You'll find the two compiled examples in the attachment.

CameraCapture is the i've been talking of now. It was an PPC app, so please use the menu to start/stop video instead of the buttons. To exit push back or home. FIles are saved as "\storage card\video1.asf"

ceCamera2 is the other example, using the pre-built function.. it makes videos with much lower FPS but somewhat better encoding (saw-edges are present however). Files are saved as "\storage card\prova1.wmv" (no matter what you type in the program, and please don't type anything as I didn't test that ;) )

You can select the resolution, the SP5m supports 176x144, 320x240, 352x288.

To capture video you must also go into the menu and select Mode->Video only, and then Video types->Standard.

please let me know what do you think of these....

camera.zip

0

Share this post


Link to post
Share on other sites

Posted · Report post

I am very interested in your work here. I will test the camera apps when I get home from work. I have some prgramming experiance, however I don't have visual studio and the dev kit for win-mo so unfortunately I can't tinker around. What I was hopping is that you might be the person to figure out how to increase the shutter speed (f-stop?) on the camera in the HTC tornado. It could be slightly faster as it currently overexposes and causes motion blurring (and the camera is always moving as its hard to hold), so we could certainly shave some time of the shutter and still take reasonably lit picks.

-Kap

0

Share this post


Link to post
Share on other sites

Posted · Report post

Very interesting work. I will definitely test it. :-) Keep on with your work. I really hope we will get a decent video recording app. :-D

0

Share this post


Link to post
Share on other sites

Posted · Report post

I've gone a bit further with the CameraCapture example, after a brief directshow tutorial.

I managed to get it streaming at 320x240, but the frame rate is uncontrollable... it reports it can do 7 to 15 FPS, but it always does 30 no matter what I set ;) (at 176x144 it did 60 FPS!!!!!)

I think this is a limitation of the htc camera driver.

Also I can't change nothing about the compression details... all methods return "Not Implemented".

The output isn't so bad, all in all, but the image coming from the camera (or perhaps from the HTC driver) is already saw-edged, and the compression has a strange effect of leaving white pixels all around when there are sharp borders in the image.

Also encoding takes a lot :D

You'll find the two compiled examples in the attachment.

CameraCapture is the i've been talking of now. It was an PPC app, so please use the menu to start/stop video instead of the buttons. To exit push back or home. FIles are saved as "\storage card\video1.asf"

ceCamera2 is the other example, using the pre-built function.. it makes videos with much lower FPS but somewhat better encoding (saw-edges are present however). Files are saved as "\storage card\prova1.wmv" (no matter what you type in the program, and please don't type anything as I didn't test that :( )

You can select the resolution, the SP5m supports 176x144, 320x240, 352x288.

To capture video you must also go into the menu and select Mode->Video only, and then Video types->Standard.

please let me know what do you think of these....

Hello any chance you could share a source for the changing of the resolution and framerate? I am using a HTC P3600 and when I use the camera capture sample i get a 160x120 video using very low frame rate...

Thanks

Domenico

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hello any chance you could share a source for the changing of the resolution and framerate? I am using a HTC P3600 and when I use the camera capture sample i get a 160x120 video using very low frame rate...

Thanks

Domenico

Hi Domenico,

I'm considering buying a Qtek 8500 but i've heard that some phones don't allow custom applications to be run on them. Have you experienced that, if so was it easy to unlock?

I've never developed for Windows Mobile, but in DirectShow on WinXP you can change resolution by creating your own subclass of CTransInPlaceFilter and changing this function:

HRESULT MyFilter::CheckInputType(const CMediaType *proposedType) {
if ((proposedType->majortype != MEDIATYPE_Video) || proposedType->subtype != MEDIASUBTYPE_RGB24 ||
proposedType->formattype != FORMAT_VideoInfo || (proposedType->cbFormat < sizeof( VIDEOINFOHEADER )) )
{
return VFW_E_TYPE_NOT_ACCEPTED;
}

BITMAPINFOHEADER bmiHeader;
if ( proposedType->formattype == FORMAT_VideoInfo ) {
bmiHeader = ((VIDEOINFOHEADER*)proposedType->pbFormat)->bmiHeader;
} else {
/* For some reason this might lead to errors, so header2 is no longer allowed. */
bmiHeader = ((VIDEOINFOHEADER2*)proposedType->pbFormat)->bmiHeader;
}

/* data must be uncompressed 3 channels, 8 bit per channel and no padding */
if ( bmiHeader.biSizeImage != abs( bmiHeader.biWidth * bmiHeader.biHeight * 3 ) ||
bmiHeader.biCompression != BI_RGB || bmiHeader.biBitCount != 24 ) {
return VFW_E_TYPE_NOT_ACCEPTED;
}

return S_OK;
}
[/codebox]

You can VFW_E_TYPE_NOT_ACCEPTED if bmiHeader.biWidth or bmiHeader.biHeight is not to your liking. The filter doesn't have to do anything, but you can but it between the camera and the encoder to control image type.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Domenico,

I'm considering buying a Qtek 8500 but i've heard that some phones don't allow custom applications to be run on them. Have you experienced that, if so was it easy to unlock?

I've never developed for Windows Mobile, but in DirectShow on WinXP you can change resolution by creating your own subclass of CTransInPlaceFilter and changing this function:

HRESULT MyFilter::CheckInputType(const CMediaType *proposedType) {
if ((proposedType->majortype != MEDIATYPE_Video) || proposedType->subtype != MEDIASUBTYPE_RGB24 ||
proposedType->formattype != FORMAT_VideoInfo || (proposedType->cbFormat < sizeof( VIDEOINFOHEADER )) )
{
return VFW_E_TYPE_NOT_ACCEPTED;
}

BITMAPINFOHEADER bmiHeader;
if ( proposedType->formattype == FORMAT_VideoInfo ) {
bmiHeader = ((VIDEOINFOHEADER*)proposedType->pbFormat)->bmiHeader;
} else {
/* For some reason this might lead to errors, so header2 is no longer allowed. */
bmiHeader = ((VIDEOINFOHEADER2*)proposedType->pbFormat)->bmiHeader;
}

/* data must be uncompressed 3 channels, 8 bit per channel and no padding */
if ( bmiHeader.biSizeImage != abs( bmiHeader.biWidth * bmiHeader.biHeight * 3 ) ||
bmiHeader.biCompression != BI_RGB || bmiHeader.biBitCount != 24 ) {
return VFW_E_TYPE_NOT_ACCEPTED;
}

return S_OK;
}
[/codebox]

You can VFW_E_TYPE_NOT_ACCEPTED if bmiHeader.biWidth or bmiHeader.biHeight is not to your liking. The filter doesn't have to do anything, but you can but it between the camera and the encoder to control image type.

Hi, on the HTC P3600 there is no restriction on developing custom apps. On the other hand every phone has a different implementation of directshow,

resulting in a very unpredictable development process.

Thanks

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.