DirectShow.NETCF
DirectShow.NETCF - Library that allows you to use DirectShow (play multimedia, capture/compress/recompress/preview audio and video) on Windows Mobile 5 or older devices.
Current version: 2.2.0.0
Available:
DirectShowNETCF
ComImports + PInvoke necessary API + some useful classes and methods
DirectShowNETCF.Player
Player class allows you to play audio and video files.
Methods:
- public bool renderFile(string fileName) - build graph for required file if it possible
- public bool play() - starts or continues play media file
- public bool stop() - stops play file
- public bool pause() - pauses play file
- public bool setVideoWindow(IntPtr owner) - if it video file then you can set control that video should be rendered on
DirectShowNETCF.Camera
Allows you to preview video from camera, still images (still images and preview in the same time) in future record video.
Methods and Properties:
- public CaptureType CapType - you can set one of type Preview, Still, PreviewStill
- public bool init() - builds graph (note: you should set CaptureType, befor init camera)
- public void release() - destroys graph (free all camera resources)
- public void stop() - stops graph
- public bool run(IntPtr owner) - runs graph and starts render captured video on required control
- public bool run() - runs graph
- public bool stillImage(string tmpPath) - stills and saves video.
- public List<string> getMediaTypes() - returns list of supported resolutions
- public void setMediaType(int index) - changes resolution from current to required
- public bool resize(IntPtr owner, int width, int height) - call this method if you resized preview control and you want preview to be stretched for new control size
- public bool flashOn() - turns flash on
- public bool flashOff() - turns flash off
- public bool zoomOut() - Zoom -
- public bool zoomIn() - Zoom +
- public bool focusMinus() - Focus -
- public bool focusPlus() - Focus +
- public bool autoFocusOff() - Turns Off autofocus
- public bool autoFocusOn() - Turns On autofocus
DirectShowNETCF.Camera.AMCamera
Allows you to preview video from camera and grab raw frames, also allows to receive frames from camera without previewing
Methods and Properties:
- public bool init(bool nullPreview) - builds graph
- public void release() - destroys graph (free all camera resources)
- public void stop() - stops graph
- public bool run(IntPtr owner) - runs graph and starts render captured video on required control
- public IntPtr grabFrame(ref long bufSize) - returns raw frame and buffer size, you have to free buffer when you dont need it (call DirectShowNETCF.PInvoke.LocalFree(IntPtr))
- public bool getGrayScaleImage(IntPtr scan0, int stride) - grabs raw frame and make grayscale image from it. Now works wor rgb565 and YV12 formats.
- public void getParams(out int width, out int height, out RawFrameFormat format) - returns width, height and format of raw frame
- public void startDrawText(string text) - draws text on preview
- stopDrawText() - stops draw text
- public List<string> getMediaTypes() - returns list of supported resolutions
- public void setMediaType(int index) - changes resolution from current to required (you have to call init and start again after changing resolution)
- public bool resize(IntPtr owner, int width, int height) - call this method if you resized preview control and you want preview to be stretched for new control size
- public bool flashOn() - turns flash on
- public bool flashOff() - turns flash off
- public bool zoomOut() - Zoom -
- public bool zoomIn() - Zoom +
- public bool focusMinus() - Focus -
- public bool focusPlus() - Focus +
- public bool autoFocusOff() - Turns Off autofocus
- public bool autoFocusOn() - Turns On autofocus
- public bool drawTarget(Rect rect, int type) - draws target on preview, you can define rect and target type
- public bool stopDrawTarget() - stops draw target on preview
- public bool getRgb565(IntPtr scan0) - grabs raw frame and makes rgb565 image from it. Now works wor rgb565 and YV12 formats.
DirectShowNETCF.Camera.AMCameraEx
Allows you to preview video from camera, grab raw RGB24 frames, apply effects for video, draws up to 10 bitmaps on preview
Methods and Properties:
- public bool init(RotationType rotationType) - builds graph (you can choose type of rotation: None, Auto, Degree90)
- public void release() - destroys graph (free all camera resources)
- public void stop() - stops graph
- public bool run(IntPtr owner) - runs graph and starts render captured video on required control
- public void fixPreview(bool fix) - fixes preview for Toshiba and LG devices as they have incorrect Chroma buffer ordering
- public IntPtr grabFrame() - returns raw frame (RGB24, size = 3 * width * height), you have to free buffer when you dont need it (call DirectShowNETCF.PInvoke.LocalFree(IntPtr))
- public void applyEffect(Effets effect) - applies one of availabel effects (none, grayscale, black and white, sepia, edge detection and cropoval)
- public void drawBitmap(IntPtr ptr, int id, int x, int y, int width, int height) - draws bitmap on preview
- public void drawTransparentBitmap(IntPtr ptr, int id, int x, int y, int width, int height, int r, int g, int b) - draws bitmap on preview except pixels that the same with transparent color
- public void blendBitmap(IntPtr ptr, int id, int x, int y, int width, int height, int blend) - blends preview and required bitmap
- public void eraseBitmap(int id) - Erases earlier drawn bitmap
- public void getRect(out int width, out int height) - returns width and height of raw frame
- public List<string> getMediaTypes() - returns list of supported resolutions
- public void setMediaType(int index) - changes resolution from current to required (you have to call init and start again after changing resolution)
- public bool resize(IntPtr owner, int width, int height) - call this method if you resized preview control and you want preview to be stretched for new control size
- public bool flashOn() - turns flash on
- public bool flashOff() - turns flash off
- public bool zoomOut() - Zoom -
- public bool zoomIn() - Zoom +
- public bool focusMinus() - Focus -
- public bool focusPlus() - Focus +
- public bool autoFocusOff() - Turns Off autofocus
- public bool autoFocusOn() - Turns On autofocus
NullCamera
Allows to grab frames from camera without preview
Methods:
- public bool init() - builds grap
- public void release() - destroys graph
- public void stop() - stops graph
- public bool run() - runs graph
Events:
- EventHandler<FrameEventArgs> GotFrame - fires every time we got new frame from camera.
AMCameraExControl 1.5.0.0
Control that allows you to preview stream from camera, grab bitmaps, draw bitmap on preview, control flash/focus/zoom (if your camera allows it)
Methods and Properties:
- public bool Start() - starts preview
- public void Stop() - stops camera
- public Bitmap GrabFrame() - grabs current frame and returns it as Bitmap
- public void FixPreview(bool needFix) - fix preview for Toshiba and LG devices
- public void Overlay(Bitmap bmp, int id, int x, int y) - draws bitmap on preview, x and y - coord of left top corner, id - id that will be used to erase bitmap when you need
- public void OverlayTransparent(Bitmap bmp, int id, int x, int y, Color transparentColor) - draws bitmap on preview except pixels that equal to transparentColor, x and y - coord of left top corner, id - id that will be used to erase bitmap when you need
- public void BlendBitmap(Bitmap bmp, int id, int x, int y, byte blend) - blends preview and passed bitmap
- public void eraseBitmap(int id) - Erases earlier drawn bitmap
- public Effects Effect - allows you to aplly 1 of supported effects (None, GrayScale, BlackAndWhite, EdgeDetection, CropOval)
- public bool FlashOn() - turns flash on
- public bool FlashOff() - turns flash off
- public bool ZoomOut() - Zoom -
- public bool ZoomIn() - Zoom +
- public bool FocusMinus() - Focus -
- public bool FocusPlus() - Focus +
- public bool AutoFocusOff() - Turns Off autofocus
- public bool AutoFocusOn() - Turns On autofocus
- Allows to handle mouse click (mouse down)
PlayerControl 1.5.0.0
Player class allows you to play audio and video files and mms streams. Also player allow to seek on media, control volume and grab frames.
Properties:
- public bool Loop - if true then when video ended starts play again
- public int VideoWidth - real video width
- public int VideoHeight - real video height
- public int Volume - you can control player volume (range 0-10000)
- public int Balance - you can control sound balance
- public int BitRate - video bitrate if possible to detect
Methods:
- public void OpenFile(string filePath) - Builds graph that allows to play required file
- public void Play() - starts or continues play media file
- public void Stop() - stops play file
- public void Pause() - pauses play file
- public void Seek(TimeSpan position) - Sets media to required position
- public TimeSpan GetDuration() - Gets Duration of media file
Events:
- public event EventHandler MediaFailed - fiers if its impossible to render file
- public event EventHandler MediaEnded -fiers when file plaed to the end
- public event EventHandler<ProgressEventArgs> MediaProgress - fiers every 0,3 seconds and informs about current progress
P.S:
July 7th, 2009 at 5:06 pm
I have downloaded DirectShowNETCF and seems to be working fine! Great job, took me a week to implement half of the functionality in C++
- too bad I hadn’t come across this lib earlier, would have saved loads of time!
Still, I’,m having a problem. The “GetGrayScale” button in the AMCamera example doesn’t seem to work. The bmp generated contains black pixels only.
I tried changing the PixelFormat to Format16bppRgb565 (are reported from cam_.getParams) but still no luck.
Any ideas would be greatly appreciated!
July 7th, 2009 at 5:21 pm
GetGrayScale works only on YUV formats, on Rgb565 it should return false!
P.S. it aint problem to implement for RGB formats
July 8th, 2009 at 10:12 am
You are right!! I tried it on my old HTC (3600) which returns the data in YV12. The function returns true, however I still get a black image. However, this phone is behaving very strangely lately, so I can’t b sure what’s wrong.
On my new HTC, which returns data in 16bppRgb565 how can I make that work. I assume something needs to be changed in the native dll, right? Is your source available, I’d be happy to do it.
I would b eternally greatfull if you could provide a solution, otherwise I will have to implement the whole thing from scratch
Thx in advance!
July 8th, 2009 at 10:43 am
AMCamera got public method getFrame (it return IntPtr that contain raw buffer)
[csharp]
int width;
int height;
DirectShowNETCF.RawFrameFormat format;
cam_.getParams(out width, out height, out format);
Bitmap bmp = new Bitmap(width, height);
System.Drawing.Imaging.BitmapData data = bmp.LockBits(new Rectangle(0, 0, width, height),
System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
//cam_.getGrayScaleImage(data.Scan0, data.Stride);
long size = 0;
IntPtr buff = cam_.getFrame(ref size);
Marshal.WriteIntPtr(data.Scan0, buff);
DirectShowNETCF.PInvoke.LocalFree(buff);
bmp.UnlockBits(data);
bmp.Save(textBox1.Text, System.Drawing.Imaging.ImageFormat.Bmp);
[/csharp]
July 8th, 2009 at 11:07 am
Thx for your quick response.
I assume you are refering to grabFrame() not getFrame()
Still no luck, I get all black pixels. Any more ideas?
July 8th, 2009 at 12:12 pm
hm… maybe sample grabber not work correct, but if preview works then samplegrabber sgould work correct too! maybe you doing something wrong, but i definitly dont know what
July 8th, 2009 at 12:47 pm
i would post source, but I haven’t changed anything in your example, I just compiled and run. Anyway, i will investigate further.
July 8th, 2009 at 12:56 pm
the easiest way to check if sample grabber works is to try draw text, but as i remeber it should not work correct on RGB formats
July 8th, 2009 at 1:43 pm
It kinda works…I can see the text being drawn in extemely small font.
So should I that the sample grabber works? And if it works why can’t I save the data in a file? I can seen that grabFrame() returns size > 0.
I think that the pointer is actually filled with the image data, I’m just unable to use them…maybe the device is lying about the pixel format??
Anyway, I’ll try passing the raw data to another application and try and process them that way….maybe that will work.
July 8th, 2009 at 2:01 pm
can you save raw data file and email it to me? also please email frame format (width, height, fixiel format)
July 8th, 2009 at 4:19 pm
The problem was when copying the raw data using Marshal.WriteIntPtr(data.Scan0, buff)
As a workaround (used ur code), I first copy the data to a byte array and then to the bmp
long size = 0;
IntPtr buff = cam_.grabFrame(ref size);
byte[] array = new byte[(int)size];
Marshal.Copy(buff, array, 0, (int)size);
Bitmap bmp = new Bitmap(width, height);
BitmapData data =
bmp.LockBits(
new Rectangle(0, 0, width, height),
ImageLockMode.ReadWrite,
PixelFormat.Format16bppRgb565
);
System.Runtime.InteropServices.Marshal.Copy(array, 0, data.Scan0, array.Length);
bmp.UnlockBits(data);
//bmp.Save(”\\My Documents\\testtest.bmp”, System.Drawing.Imaging.ImageFormat.Bmp);
array = null;
DirectShowNETCF.PInvoke.LocalFree(buff);
I can’t thank you enough
!!!
July 10th, 2009 at 10:46 am
Nice library, I tested it and works great.
Do you plan to support flash for camera?
Thank you
July 10th, 2009 at 3:45 pm
Yes, sure… one day i will add it
July 14th, 2009 at 1:54 pm
First of all, congratulations!!! this is a really good job!!!
I have a question about the the Raw Frame Format, is there any way to define width and heigth of the frame? and also the position of that frame in the screen?
July 14th, 2009 at 2:28 pm
Hi sasha
the library doesn’t work in CF 3.5.
July 14th, 2009 at 2:51 pm
2Pet:
a) getParams(out int width, out int height, out RawFrameFormat format)
b) did not get your secont question
2Marche:
ok, ok i`m checking it right now
July 14th, 2009 at 4:28 pm
Sorry, I’ll try to explain my problem better.
My preview area is bigger (almost full screen) than frame size (capture area) i would like to increase the capture area (frame size) and also center this capture area into the preview area.
In my HTC for example I have a preview area (panel) of 240×260 but getParams() gives me a frame size of 120×160
Thanks a lot!
July 14th, 2009 at 4:52 pm
ah, ok… will add it in next build (when found whats wrong with net cf 3.5)
July 14th, 2009 at 8:02 pm
2Pet: i added methods that allow to enumerate suported mediatypes + change for required (methods works the same as in Camera class)
2All: bug with .net cf 3.5 fixed
Regards,
Alex
July 15th, 2009 at 6:15 am
Hi
I really like this library…
But I get a black pixel….
I used this code from cHRIS but I can get a good pic…
long size = 0;
int width;
int height;
DirectShowNETCF.RawFrameFormat format;
cam.getParams(out width, out height, out format);
IntPtr buff = cam.grabFrame(ref size);
byte[] array = new byte[(int)size];
System.Runtime.InteropServices.Marshal.Copy(buff, array, 0, (int)size);
Bitmap bmp = new Bitmap(width, height);
BitmapData data = bmp.LockBits(new Rectangle(0, 0, width, height),ImageLockMode.ReadWrite,PixelFormat.Format16bppRgb565);
System.Runtime.InteropServices.Marshal.Copy(array, 0, data.Scan0, array.Length);
bmp.UnlockBits(data);
bmp.Save(”\\grises2.bmp”, System.Drawing.Imaging.ImageFormat.Bmp);
array = null;
DirectShowNETCF.PInvoke.LocalFree(buff);
any ideas?….Thank
July 15th, 2009 at 8:19 am
How can I use DirectShow or this helpful library to stream MP3 audio from the internet on a Windows Mobile device? I keep hearing there needs to be a DirectShow filter.
July 15th, 2009 at 8:28 am
Thank you again Alex.
Testing it right now.
Have a nice day!
July 15th, 2009 at 10:08 am
2Mike Murray:
if you need receive an play stream from interner you need push source filter, if you need to send data to internet then audio capturing not implemented yet
2Makt:
what walue of format after calling cam.getParams(out width, out height, out format)?
July 15th, 2009 at 11:58 am
Thanks Alex, great job!
Unfortunately my HTPC only gives me one valid media type 120×160 when i call to getMediaTypes (is this a normal situation?) .
July 15th, 2009 at 12:02 pm
Seems like thats normal situation for HTC devices
July 15th, 2009 at 7:22 pm
I need to receive and play stream from internet. What is a push source filter and where can I find one?
Thank you.
July 15th, 2009 at 10:08 pm
I think you should implement filter because any filter for windows mobile its a rare thing
July 15th, 2009 at 11:25 pm
Do you have an links to show how to create a DirectShow filter compatible with Windows Mobile?
July 15th, 2009 at 11:38 pm
You can check examples for Windows the almos no differende, but if you want windows mobile filters then you should search on codeproject.com there were couple
July 16th, 2009 at 1:23 pm
Yep HTC camera is not very good.
Your library works great!!!
Are you thinking in implementing a startDrawImage method? It could be very useful for drawing a frame at the border of the capture area (or even obscure a little the non-capture area)
Thanks
July 16th, 2009 at 1:44 pm
I got a lot of plans (drawing images, flv player, rtsp/rtmp live stream player, youtube and similar sites player so on), but i dont have enough free time and sometimes motivation, so i cant promise anything
July 23rd, 2009 at 9:39 pm
I also have an HTC device. using cHRIS’s example, I am able to get an image. But, I have 2 questions.
1. Since I have an HTC, the resolution is really low. Can I force a higher res, even though it only reports a lower one?
2. Is there anyway to take a picture without the preview running? I would like to just have it go to memory and not have to run the preview.
July 23rd, 2009 at 11:34 pm
Ok, I have figured out my second one. I may need to have the preview running, but I don’t need to display it. I can pass System.IntPtr.Zero to the cam_.run() function and I still get an image when I grab the frame.
So, now if I can figure out how to take higher resolution pics, it would be great. It will take 240×320 (what getMediaTypes reports) pictures, but the camera is 3.2MP. Normal pictures are 1536×2048. Any advice would be greatly appreciated.
July 24th, 2009 at 12:45 pm
Hi alex, I tried the idmowrapperfilter. I keep having an error, it says cannot convert from ‘System.Guid’ to ‘DirectShowNETCF.CGuid’ for the 2 attributes at the last line when i try to call dmoFilter.init(). Please advise, thanks.
private IDMOWrapperFilter dmoFilter = null;
private IBaseFilter encoder = null;
#region DMOWrapper
clsid = CLSID_.DMOWrapperFilter;
riid = IID_.IBaseFilter;
PInvoke.CoCreateInstance(ref clsid, IntPtr.Zero, (uint)CLSCTX_.INPROC_SERVER, ref riid, out obj);
encoder = (IBaseFilter)obj;
if (encoder == null)
{
return false;
}
#endregion
obj = null;
hr = dmoFilter.Init(CLSID_.CWMV9EncMediaObject, CLSID_.DMOCATEGORY_VIDEO_ENCODER);
July 26th, 2009 at 8:32 am
hi alex, how can i create a nullrenderer filter as I know it is not supported in your current version of the DirectShowNETCF library.
July 28th, 2009 at 10:19 am
2Howler i know HTC phones got that problem (i think this is directshow driver)
2nemo you should call init like this:
hr = dmoFilter.Init(new CGuid(CLSID_.CWMV9EncMediaObject), new CGuid(CLSID_.DMOCATEGORY_VIDEO_ENCODER));
2jd C++
July 28th, 2009 at 2:24 pm
Hi Alex
Can you give an example on how to activate the flash?
Thank you
July 29th, 2009 at 1:38 pm
Hi Alex,
Just stumbled upon this library and seems really cool though I too need support for the device’s flash. Any chance you could slip this in some time soon?
July 29th, 2009 at 5:54 pm
the problem that on my (samsung i710) nothing about flash so i cant even test, but may be will add it soon untested
July 30th, 2009 at 4:19 am
Hi Alex,
I try to use your player running on my wince5.0 device,
but it seem just can play video in fullscreen mode,
do you know how to do with this problem?
July 30th, 2009 at 4:50 pm
Can this class be used on the windows mobile 6 standard edition?
I was trying to write some codes to test it on my wm6 smartphone, it seems it doesn’t work.
It returns “:(”.
Is there any possibility that I omitted some vital codes?
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace DirectShowCameraTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
cam_ = new DirectShowNETCF.Camera.AMCamera.AMCamera();
}
DirectShowNETCF.Camera.AMCamera.AMCamera cam_ = null;
private void menuItem1_Click(object sender, EventArgs e)
{
if (menuItem1.Text == “Start”)
{
menuItem1.Text = “Stop”;
if (!cam_.run(panel1.Handle))
{
MessageBox.Show(”:(”);
}
}
else
{
menuItem1.Text = “Start”;
cam_.stop();
}
}
private void menuItem2_Click(object sender, EventArgs e)
{
cam_.stop();
cam_.release();
Close();
}
}
}
July 30th, 2009 at 5:44 pm
i dont have windows mobile 6 standard edition, so i cant test but i`m almost 100% sure that its possible, maybe small bug that should to be fixed
August 3rd, 2009 at 4:05 pm
hello, i have run your code on my asus p535 successfully, but there is a problem that the run(IntPtr owner) returns a rotated image, are there any methods to rotate it back?
thx
Sam
August 4th, 2009 at 11:02 am
Hi. I want Question.
AMCamera class
” public void setMediaType(int index)”
I used this method. So changed resolution in display.
but
“public IntPtr grabFrame(ref long bufSize)”
used Capture file is no change resolution.
How to make Changed resolution Capture file??
August 4th, 2009 at 7:02 pm
Hello, I am a korean student who subscribe to your blog
hmm.. I have a question.
I had no error in Visual studio.
But I had a error in mobile device, after making a cab file.
Error is [Pinvoke DLL, Cannot find “DirectshowNETCF.Native.dll”]
I am not able to include DirectshowNETCF.Native.dll in References.
Give me a piece of advice.
August 4th, 2009 at 8:13 pm
2LEE you dont need to add it as reference you just need to put it into the same folder where executable placed
2Steve, dont know maybe my bug… have to check
August 8th, 2009 at 8:21 pm
I have a HTC HD, that has two cameras.
How can I detect them with the library ?
August 12th, 2009 at 9:44 am
Hi, I have a question regarding AMCamera example. Im using Windows Vista, Visual Studio 2008 Pro and Windows Mobile 5 and 6 sdk. I keep getting Error for [Pinvoke DLL, Cannot find “DirectshowNETCF.Native.dll”]. I have tried putting the dll file in the folders where the exe exists, clean and rebuild but it still gives me the error. Please advise, thanks.
August 12th, 2009 at 9:51 am
You have to put it on device (folder where exe placed)
August 12th, 2009 at 11:52 am
I’ve got it, problem resolved. thanks alex
August 18th, 2009 at 12:57 pm
Added methods flashOn and flashOff to Camera and AMCamera classes
P.S. methods untested
August 25th, 2009 at 12:45 pm
Also having the problem that to get the AMCamera code working, it appears to rotate it fully around, upside down and reversed. I’m guessing the array is going in the wrong direction when converting, but if I Array.Reverse, the colours get what appears to be solarised (RGB values getting borked when reversed I’d guess).
The preview works, and works well, I just can’t get an image saved that matches the preview (and all the examples I look up don’t have all the methods for compact framework).
If someone’s fixed the image and it saves right, any advice humbly appreciated.
Cheers.
August 25th, 2009 at 4:19 pm
when i press Init i get the following: cannot init camera! Reason: ConnectGrabberError_1. I’m using Windows Mobile 6.1 Professional. any ideas why tis happens? thanks
August 26th, 2009 at 6:53 pm
I am currently trying out ur library - looks nice so far. But I’ve got one question: How do I tell the camera how much space (width/height) it may take on the screen? In ur examples you’re passing a panel (or rather its Handle) as the owner of the Camera (and previously you defined the width and height of that panel) - but how does the Camera know the width and height of the panel? Or am I mistaken here ?
August 26th, 2009 at 7:07 pm
GetClientRect
August 27th, 2009 at 2:12 pm
@admin: Thanks for the info - I figured, that there is no point for me to know this, except for the fact, that the owner should definitely be an UI element which has a defined width/height. Works like a charm now :o)
August 31st, 2009 at 2:10 pm
I am new to VS coming from PHP & Delphi. How do I add a button to do the following:
1. Save the file a. low quality b. high
2. Start recording the video
3. Stop recording the video.
I can add buttons and code but do not understand the complex nature of vs & C#.
August 31st, 2009 at 2:20 pm
SteveW i think that you should read some C# books to understand it
August 31st, 2009 at 4:46 pm
I have been playing around (and reading c# stuff on the web). Brain is hurting bad.
I managed to use :
List sl = cam_.getMediaTypes();
// Add strings to sl
List ol = new List();
foreach (string s in sl)
{
ol.Add((object)s); // The cast is performed implicitly even if omitted
MessageBox.Show(s);
}
But this only results in 176X144
So when I set
cam_.setMediaType(0); to cam_.setMediaType(1); it fails.
because there is only one parameter in cam_getMediaType
So how can I expose the higher resolutions. The camera application options are 1600 X 1200 1280 X 960 640 X 480 320 X 240 160 X 120
and why does do we get result 176X144?
Cheers
SteveW
August 31st, 2009 at 5:44 pm
you get only 1 resolution because directshow driver on your device does support any other… this is not my foul you can contact to device developers and ask them…
September 1st, 2009 at 6:06 pm
Hi. i was reply that how to use video capture?
i make video file, so that file format is raw format so dont read file
pls help to write file to asf or other files and show code
Thank you…
September 2nd, 2009 at 9:54 pm
Hi, i have used ur library on windows mobile 6 standard and it goes well.
But im trying to add ur library (DirectShowNETCF) on my own service but when i compile it says that ur dll has no a secure name.
Could u help me pls?
Thanks
September 9th, 2009 at 9:18 pm
I can’t get the flash work. I think there is a problem in your IAMCameraControl Interface implementation. The camera driver is well implemented I know, I could activate it with code from the vendor, is code in c++ and not open enough (closed source). I think we (the community) can work together and benefit from each other contributions, and make this the best Open Multimedia Library.
September 10th, 2009 at 12:07 am
Sorry i cant test flash as i dont have device with it, so i cant help you in this question… and yeah, i`m not going to make library open source, thats my hobby and i suppose to leave it my(!) hobby
September 10th, 2009 at 4:14 pm
Hi i am using DirectShowNETCF its working file but when i starting the camera it is taking lot of time for start camera. please suggest me how to optimise the time.
September 12th, 2009 at 4:32 pm
Hi
Thanks for your great library. Could you please build DirectShowNETCF.Native.dll for the x86 platform? I am using it on Windows CE 6.0.
Regards
Frank
September 14th, 2009 at 3:58 am
Hi could u tell how to use ur dll on other project pls?
When i try that it says that the dll has no a secure name.
It would be very helpful
Very thanks
September 14th, 2009 at 5:14 pm
Jose, what do you mea by “use ur dll on other project”? just add to reference and use it, i did test apps the same way
September 16th, 2009 at 8:59 pm
Thanks for answer me!! I refer to add how reference how you say. But i need it on a microsoft robotics studio service and it says me that your dll dont have a secure name, i have to sign it but i dont know how. Id like to know how to sign it or that you could sign it and post them again if u can.
Very thanks!!
September 18th, 2009 at 1:59 am
Hi Alex,
I’m facing some problems using this amazing library, here we go..
1) When i take a picture, cam_.stillImage(filename), the pic is just to large
at the res i’m taking (1.3MP gives me a 930kb photo), everytime i have to
convert this pic to .jpeg, giving me a ~80kb file or sometimes an OutOfMemory
Exception, can give us an option to save this file at this size at the moment we
call cam_.stillImage(filename)?
2) Could you implement an option to set the picture quality? Like Low,Normal
and high, this would be very helpfull.
3) When i preview the picture on a 237×182 panel, the image became distorted, like it was made to fit exactly a 176×144 panel, is that my fault? Is there any way to get a high res preview?
thnx in advance.
September 20th, 2009 at 11:20 pm
Hi,
I tried using your library to control mobile device camera and when I’m using Camera class, it works really great. However, I need to capture the photos directly to a bitmap object, not to a file. So I tried the class AMCamera and its method grabFrame. Unfortunately, I’m not able to get it to work correctly. When I display the resulting bitmap, there is always just a very small captured image, repeated several times (quite odd), and the rest of the bitmap contains only black pixels. I use code like this:
cam_.getParams(out width, out height, out format);
buff = cam_.grabFrame(ref size);
array = new byte[(int)size];
System.Runtime.InteropServices.Marshal.Copy(buff, array, 0, (int)size);
bmp = new Bitmap(width, height);
data = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
System.Runtime.InteropServices.Marshal.Copy(array, 0, data.Scan0, array.Length);
When I was trying to solve this problem, I noticed that the size of the grabbed frame is 28800 bytes, although returned dimensions of the picture are 160 x 120px. I think it’s quite few for these dimensions, but maybe I just do not understand well all this thing. Could you please help me to solve this problem? Thank you very much…
September 21st, 2009 at 2:29 am
Hi there,
I have to write an app for a Motorola MC75 device running Windows Mobile 6. Will DirectShow.NETCF work for me?
Just wondering because it mentions that library is for Windows Mobile 5 and Older.
If this is not the solution for me, can you recommend something for me please?
My requirements are
- MC75
- Windows Mobile 6
- C# application
Thanks
September 21st, 2009 at 7:39 am
Hi there,
I have managed to get the Camera example running on Motorola MC75 (Windows Mobile 6). However I cannot get the camera to start on any capture modes on a consistant basis.
I am pressing “Init”, then “Start”.
“Cannot start camera” when I am in “Still” mode. Program crashes on “Preview” and “StillPreview” modes
However I did have better luck with your AMCamera solution. Camera started no problems.
I really need to take a still shot but unfortunately AMCamera Object doesn’t expose any method to do this (unlike the Camera object which has A stillImage() method.
Help?
Thank you very much
September 23rd, 2009 at 11:30 pm
Hi,
I want to paint a rectangle on the panel while I see the preview of the cam, and after that I just want to have a copy of this area.
I dont know how to draw on the panel. I have tried the onPaint method of the Panel, but that doesn’t work ;o)
So how can I paint a rectangle and after that copy a rectangle out of the handle?
thanks hibbert
September 24th, 2009 at 4:06 am
Thanks for this lib. But why the preview video is so slowly?It’s much more slower than the camera program in mobile system.
September 29th, 2009 at 12:22 am
[…] Windows Mobile - Bitmap vom Panel […]
September 29th, 2009 at 2:58 pm
some changes was made in library, first of all now for if you device return video in YV12 format you can grab colored frames using grabRgb565 method (check AMCamera example). The same method you can call if camera works in RGB565
Also you can receive grayscale image for both formats (RGB565 and YV12)
You can draw target on preview (very usefull for barcode readers)
P.S. almost finished downloader/player from stream transfered by MMS protocol
September 29th, 2009 at 10:42 pm
Hi,
thank you very much for the changes in the library, the function AMCamera.getRgb565() is probably exactly what I needed, since the format of my camera is YV12. Unfortunately, when I try using the function (in the example provided with the library), the resulting image outline is OK, but colors are changed. There are (for example) too many red, rose and white pixels. Do you have any idea what could be the problem? Thank you very much in advance…
September 30th, 2009 at 10:05 am
2LuKu seems like was small bug, i uploaded fixed version
October 1st, 2009 at 1:20 am
Hi,
the new lib sounds great, but when I want to grab a RGB Image then I get an error and the application terminates
“Ausnahmecode (Exceptioncode): 0xc0000005
Ausnahmeadresse (Exceptionaddress): 0×78ef1108
Lesen (read): 0×00000000″
I’m using a Windows Mobile 6.1 Prof Device.
The same error occurs when I want to paint on the Image. Is there a was to say what should be paintet on the Previewimage?
thanks again.
hibbert
October 1st, 2009 at 3:57 pm
To Admin: Unfortunately, after the bugfix the image is still deformed. But I’ve managed to write a function for conversion from YV12 to RGB24bpp which works OK, at least on my device, so now I can use AMCamera.grabFrame() without problems. If you want, I can send you the code. Anyway, thanks for your lib again.
To Hibbert: I think I’ve already seen a similar message, unfortunately I can’t remember the cause
I will try to recall it, but since I know I was able to fix the problem, I recommend you to check again your code and deploying of DirectShowNETCF.Native.dll, because the answer is probably there…
October 2nd, 2009 at 12:38 am
Hi,
I have createt a new Project with the new files. I just forgot tu update the DirectShowNETCF.Native.dll… d’oh.
But is there a was to paint a custom Rectangle on the picture? that would be nice, or a function to use the zoom of the cam?
all in all it’s a great lib, thanks so far =)
October 2nd, 2009 at 1:59 pm
Dear admin,
I cannot do flash on/off on HTC P3700 (WM 6.1 Pro). When I do debug, IAMcamcontrol.Getrange return fail so flash function was not reached.
By the way, can I chance the position of RED rectangle in preview?
Thank you for your help.
October 3rd, 2009 at 1:43 pm
Changes was added, now you can define Rect where target should be drawn (dont forget that rect depends of frame size, not control), also you can define target type for now it can be rectangle and target like was in previous version.
P.S. i made small changes in flash function hope it will fix bug and make flashOn/flashOff workable
October 3rd, 2009 at 2:59 pm
Thank you very much for the rectangle. It works perfect.
However the flash is still off in HTC P3700. Nothing was
received when function GetRange called.
Could you please check it again?
Thank again.
October 3rd, 2009 at 5:52 pm
Dear admin,
One more thing is that the resolution is smaller the current mobile setting.
I.e. my phone has 480×640 but the picture is generated with only a haft, 240×320.
Is there any mistake for me? Thank you.
October 3rd, 2009 at 6:04 pm
2kha if flash still doesnt work then i cant fix it without device only trying to guess… when i buy new one i definitly fix it
and i dont change resolution if you receive 240×320 frames then this is you device preview resolution
October 3rd, 2009 at 6:59 pm
Thanks for the quick answer. I have try GetRange function for Zooming but it has the same error. For the resolution, the picture we see on the screen is the same size as the phone resolution (480×640), however the picture received from this library is just two time smaller (240×320). I am wonder anthing wrong here. Could you please explain to me? Thank you so much.
October 3rd, 2009 at 7:03 pm
i dont know where you see picture 480×640, anyway picture can be stratched, but if you see it in default device application you should anderstand that definitly not directshow
October 3rd, 2009 at 7:19 pm
Hi admin, this is the bigger picture I took using phone camera, while the smaller is from your directshow library. When I go to Device Settings then the phone supports QVGA 480×640 32bit so it will be nice if we can catch pictures as the same size.
BTW thanks for your help.
October 3rd, 2009 at 7:43 pm
device settings are not applicable to directshow, so it doesnt metter what you see in settings
October 4th, 2009 at 5:47 am
hi Alex, sorry i has mistake in QVGA (240×320). thank you.
October 4th, 2009 at 7:35 pm
Hey,
I have updated the Lib and the new functions are working fine
But if I take a RGB Picture and view it in a Picturebox it’s a different Picture.
It seems that an other area is grabbed, so what ever I do, I don’t get the Picture I saw in the “preview”
hibbert
October 4th, 2009 at 8:19 pm
maybe you forgot to set for example stratch property for picture box? thats why you see just part of grabbed picture! that definitly not library bug, check your code first
October 9th, 2009 at 6:33 pm
Alex,
This is amazing. Great job! I have searched the entire web and this is the only lib of its kind and I plan to implement it immediately.
I am developing on the Motorola MC55/75 and everything works perfect except the flash (sad face). Any ideas?
Lastly, do you have any restrictions on distribution with other apps, licensing etc? Or do you just prefer a donation?
But great job regardless.
October 9th, 2009 at 8:28 pm
2John and all, flash already fixed, also i added autofocus, focusPlus, focusMinus, zoomIn, zoomOut, pan, tilt, roll and iris i will try to upload new version (0.7.0.0) this weekend.
Regarding licensing: you can use library for free if you want, there nothing illegal, but if you need sources you can buy it (check buy tab) and if you want to donate you can always donate if not thats your decision and nobody wont judge you
October 10th, 2009 at 3:19 pm
Library was updated to 0.7.0.0 version, was added methods:
a) autofocusOn
b) autofocusOff
c) focusPlus
d) focusMinus
e) zoomIn
f) zoomOut
fixed methods flashOn/flashOff also AMCamera example was splited for 3 different example applications
In next version:
Exposure, image rotation (preview and grabbing) and MMS downloading/playing
October 13th, 2009 at 6:58 am
Hi admin,
All the control functions like zoom, focus or flash are not working on my device
HTC Diamond Touch P3700 :(. May be I need to change another device. Could you please advise me which model you are testing on.
Thanks,
Kha
October 13th, 2009 at 8:46 am
samsung i710 works perfect
October 14th, 2009 at 7:54 am
Alex,
I tried out your latest version 0.7 on my MC55 and the flash works great!
I have already integrated it into my project and plan to release it in a day or two. I will also be buying a copy of your source when some $$ rolls in, I am dying to see how this thing works.
Lastly, the autofocus, focusPlus, focusMinus, zoomIn, zoomOut features don’t seem to function correctly on an MC55. I don’t need those features for my project and the lib works great the way it is, but I thougt you would like to know.
John
October 14th, 2009 at 8:09 am
Thank you John
October 15th, 2009 at 9:55 am
I’ve tried this on my Samsung Omnia (i900), my Motorola MC75, and my Intermec CN3.
None of the flash/focus/zoom features seem to work on the Omnia.
The flash kinda works on the MC75 (it turns the flash on permanently, rather than flashing when taking the photo). The focus/zoom features don’t.
The works correctly on the CN3. The focus/zoom features don’t.
I assume the problem is the manufacturers haven’t fully supported the DirectShow framework within their drivers?
Great work in any case.
October 15th, 2009 at 11:42 am
Hi Admin.
I have streched the image in the pictutebox and it is rotated for 180°.
hibbert
October 15th, 2009 at 8:44 pm
2Rainchild yes this is manufacturers problem and i cant fix it! regarding flash that turns on permanently, you can turn off it by existing method flashOff when you took picture.
2hibbert i know this is SampleGrabber bug i`m going to fix it one day
October 20th, 2009 at 11:32 pm
rev 0.7.0.0 - Media player example crashes during finalization, referencing a problem in quartz.dll during RemoveFilter call. I’ve seen references on the net to this, pointing to problems with reference counts. Have you experienced problems with this?
October 21st, 2009 at 12:13 am
I havent check player class since like august 2009, but you can email me file which crashes example and i will check
October 22nd, 2009 at 3:20 pm
Oops… forgot to mention, this is running on a WinCE6 device. But still, everything works perfectly, except during finalization. The example that blows up is the one included with the package. thanks.
October 22nd, 2009 at 9:13 pm
i mean not example application, i mean file that yuo trying to play
October 23rd, 2009 at 4:03 pm
Thanks for your attention. I apologize for being so terse in my descriptions of the problem - I may have mislead you. I don’t think the particular avi file is the problem, although I can still send you the file if you wish. The crash occurs when the program shuts down - not during playback or at the end of playback. The message I’m seeing is to the effect:
A native exception has occurred
Faulting module: quartz.dll
Callback:
IGraphBuilder.RemoveFilter() by DirectShowEx.clearGraph() by Player.Finalize().
I’m running this on two different CE6 devices with the same results.
Thanks again. Cheers.
October 28th, 2009 at 4:07 pm
Hi, Alex
Any news of the 180º rotation bug? Thank you
October 28th, 2009 at 8:56 pm
i`m not sure is it bug or feature, anyway i work on another part
November 1st, 2009 at 12:52 am
Hi
Your library looks like exactly what I need. But Ive got a rather old WindowsCE 5.0 machine that has a camera. When I fire up your examples it keeps crashing because it doesnt seem to get any resolutions. Ive seen the message where it only gives one resolution. But Im getting 0;
All help greatly appreciated.
Best Wishes
Richard
November 1st, 2009 at 10:06 am
hello RichardT,
please email me i got some ideas how to fix it.
i`ll send you new version and you will test if it works
November 7th, 2009 at 11:13 pm
I’ve just downloaded the library and examples. I’m building using VS2008 and I’m getting the following error
Error 1 ‘DirectShowNETCF.Camera.AMCamera.AMCamera’ does not contain a definition for ‘getTargetedImage’ and no extension method ‘getTargetedImage’ accepting a first argument of type ‘DirectShowNETCF.Camera.AMCamera.AMCamera’ could be found (are you missing a using directive or an assembly reference?) C:\DEV\ISDV\DirectShowNETCF\Examples\CS\AMCamera\AMCamera\MainForm.cs 193 31 AMCamera
Is there a later version than 0.7.0.0 for the library?
Thanks for what looks like it will be a great peice of work.
Chris
November 8th, 2009 at 6:14 am
getTargetedImage not even in methods list, remove that part of code
November 20th, 2009 at 3:22 pm
Thanks for this dll !!!!
Can I call this dll from c++ code?
I use:
#import “./DirectShowNETCF.dll” named_guids,
and I have this error:
fatal error C1083: Cannot open type library file: ‘c:\test\directshownetcf.dll
Thanks
November 20th, 2009 at 6:18 pm
2Luis Do you mean managed C++ or unmanaged?
if you mean mannaged, then yes you can, if unmanaged, then you got all headers use directshow without these libraries
November 23rd, 2009 at 12:55 pm
sorry, I don´t know the difference between C++ managed and no managed c++
I can load the dll:
HMODULE laDll = LoadLibrary(TEXT(”.\\DirectShowNETCF.dll”));
But when I define:
DirectShowNETCF.Camera.Camera cam_ = 0;
I get:
error C2065: ‘DirectShowNETCF’ : undeclared identifier
I know that if I have the .tlh it will work. But I can´t be able to generate it.
Thanks
November 23rd, 2009 at 2:23 pm
managed is C++.NET/CLI. if you use managed C++ then you just have to add dll to references othewise you cant use it, but as i wrote earlier you got all header to use directshow
November 26th, 2009 at 12:28 am
Hello I’ve tried your camera-api and it looks greate but I’ve got the rotation-buf too. if you can’t fix that… perhaps you can implement a way to cature the video-frames without using a panel or something like that. simply grabbing the raw data… theht we can use a simple rotation-matrix a display it again.
thanks
November 26th, 2009 at 8:31 am
2CarlB, I can implement rotation, but i dont have enough time to do it, so if its so important for you, you can always buy sources and do it for you needs.
BTW panel or any other control using for rendering, not for capturing
November 26th, 2009 at 10:02 am
Hello ,
First of all …
Thanks for your master piece !
I got some problem on this …
Is that possible to get the progress position in the player ?
Thanks again ~
November 26th, 2009 at 1:23 pm
2howard, not yet, maybe one day…
November 27th, 2009 at 8:22 pm
Thanks for your reply… the “need” for rotation ist nor the problem… I wouldn’t need it, when the video would be correct in the panel. even your samples are showing the vide rotated. so it’s not a missing feature, it’s a bug.
I promis, I’ll buy your sources if it will work correct… or let’s make it short… waht would it cost to correct it? I dont need the sources, I need only the ability to show the actual video to the user (with overlay) and grab some images while the preview is shown.
btw. return the GrabFrame-method a “screenshot” from the preview or does it deliver a “real” image (640×480) for example?
November 27th, 2009 at 10:26 pm
CarlB, you can always build simple DirectShow graph and check that image rotated on some devices, so if its bug, then it definitly not my.
you can always check frame returned by GrabFrame and see is it screenshot or not. Also you can read SampleGrabber docs and you will find answer for question regarding “screenshot”.
P.S. if you need some custom features use email or skype instead commenting…
November 29th, 2009 at 1:51 am
version 1.1.3.0:
1. AMCamera now text draws after target (so target wont be drawn over text)
2. AMCameraEx memory leak fixed
3. AMCameraEx fixed bug “ConnectGrabberError_2″, now class should
work correct on all devices
4. AMcameraEx fixed conversion from RGB565 to RGB24
5. AMCamera fixed drawing text on RGB565
6. AMCamera fixed conversion from YV12 to RGB565
7. AMCameraEx edded Edge Detection effect
P.S. Tested on Samsung i710 and Toshiba Portage G910
November 30th, 2009 at 1:32 am
Hi, Im a beginner but I have successfully managed very well with your DLL. I am using it on a standard Windows Mobile 6.1 phone and everything works. Except the preview image is upside down. I compiled up your example and the preview image there is also inverted. But I cant seem to find a way to invert the image back. Sorry if its a silly question but have I missed something?
All help greatly appreciated.
Thanks
Richard
November 30th, 2009 at 5:30 pm
hello, I’m developing a mobile application. HTC currently have a 3.0 MegaPixel. I used your dll and I am very pleased with their use. But like everything else I have a little problem: (will not let me change the resolution to 240×320 for better. SetMediaType I have used for this, but when I try to setearlo May-zero number, my application fails. Now, there is a way for using This library allows me to work at a resolution greater than or equal to 640×480.
Thanks and I hope your answer.
Greetings
Diego
pd: Sorry about my English. but it is very bad: P
December 1st, 2009 at 11:44 pm
DirectShowNETCF 1.3.2.0 released:
1. Fixed Samsung devices bug (image rotated 90 degree)
2. Fixed bug “grabbed frame inverted”
P.S. fixed in AMCameraEx/AMCameraExControl
December 3rd, 2009 at 9:34 am
There was bug, with rotation as result on some devices you could receive init errors or even crash, this bug fixed and new version uploaded
December 7th, 2009 at 5:38 pm
How are you?. Hey tried to use the latest version “1.3.2.0 released” and yet still the same problems: 1) It allows me to change to 240×320 the largest resulusion. 2) the image goes upside down. Is there a solution to for my HTC may not have these problems? because I want to buy your product.
greetings and await your prompt response
Diego
December 7th, 2009 at 6:37 pm
Hello Diego,
1) if your device doesnot allow to change resolution it means that this max that you directshow driver allows and it cannot be fixed
2) i`m working on upside down problem now
December 10th, 2009 at 12:04 am
version 1.4.0.0 released:
1) bug that AMCameraEx aint work on some devices - fixed
2) 90 degree rotated preview on some samsung devices - fixed
3) upside down preview - fixed
4) autofocus - should work on most samsung devices (at least Omnia and m840)
5) added resize method for all camera`s classes
December 10th, 2009 at 10:46 am
is there a history of changes in each version available ?
December 10th, 2009 at 2:05 pm
to kamil, nope, but if its important i can start it with new version
December 10th, 2009 at 2:29 pm
@admin: i think that should be mandatory in any project.
i am trying to discover if there were any changes that could affect stability (in a positive way) of our software since 0.5.6.4
December 10th, 2009 at 2:33 pm
2kamil: you can always save old version then replace it by new and check results if there will be problems you can always get back for using version that you have.
Anyway 1.4.0.0 got ton of bugs fixed and lots new features
December 10th, 2009 at 6:35 pm
Just to say thanks for this great new version!
December 10th, 2009 at 11:56 pm
version 1.4.5.0 released:
1) AMCameraEx fixed memory leak
2) AMCameraEx changes in init method, now you can set RotationType:
None, Auto or Degree90
3) Started bugs/feature history
December 12th, 2009 at 3:20 pm
The rotation problem on my hd2 is fixed now… but with the newest version the preview has a “freaky” effect you can see nothig… only green flickering.
and focusPlus, focusMinus autoFocus and flashOn and flashOff did not work on htc-devices (hd, hd2, touch pro and diamond2) if you can fix this you’ve a new customer
December 12th, 2009 at 9:51 pm
i need movie file such as avi….
what shall I do?
December 12th, 2009 at 10:14 pm
2jangyoun video recording not implemented yet, i can record yuv avi file but it will create too big files… so i`m working on compression
December 12th, 2009 at 10:16 pm
2CarlB preview seems like i fixed (will be in next version), but autofocus if somebody could fix this is driver developers from htc team, definitely not me
December 13th, 2009 at 3:56 pm
version 1.5.1.0 released:
1) AMCameraEx - fixed preview for HTC (RGB565) devices
2) AMCameraEx - now you can draw up to 10 Bitmaps on preview
December 16th, 2009 at 6:08 pm
Hello. Question: Why do I get green on AMCameraEx?.
thanks
Diego
December 16th, 2009 at 6:39 pm
2Diego, i dont know, probably problem with conversion.
what exactry device? whats frame format, width, height returns AmCamera?
December 17th, 2009 at 9:13 pm
Hello. How are you?. The problem I have is that when the project AMCameraEx use the preview of the film turns green. I currently use a HTC Tytn 2 (http://www.techgadgets.in/images/htc-tytn-ii-phone.jpg) to phase out single maximum resolution of 240×320. And I have to do is like a scanner of QR codes, thus requiring high image quality, or very acceptable.
Sorry for my English that is very, very bad.
greetings and apologies for any inconvenience.
Diego
December 22nd, 2009 at 6:21 pm
Hello, how are you?, A question: Why can not operate the autofocus ()?
thanks.
Diego
December 23rd, 2009 at 12:41 pm
2Diego,
autofocus aint work on HTC (at least in directshow)
resolution the same problem…
December 23rd, 2009 at 4:03 pm
What does the MMSWriter do? Can someone supply some sample code on how to use it?
December 23rd, 2009 at 5:29 pm
2Scrappy, class was made to save video/audio streams that streams via MMS protocol, but i did not include it in library, i still thinking if it should be in library at all…
BTW preview MMS streams you can by PlayerControl
December 24th, 2009 at 2:54 pm
Announcement:
next build will contain workable flash and autofocus for HTC devices!
December 25th, 2009 at 6:29 am
version 1.6.0.0 released:
1) Flash and AutoFocus for HTC devices (Untested, but should work)
2) Some Native bugs fixed
P.S. Merry Christmas and Happy New Year
December 26th, 2009 at 4:36 pm
Mery Christmas to all!
I’ve tried the new version (1.6) but the preview is still “green” ans what I can see it is still flipped (I’ve tested it on an HTC Touch Pro).
On an HTC HD2 the preview is fine (but extreme slow) and non of the methonds on camera-object does work (autofocusOn, focusMinus, focusPlus, zoomIn, zoomOut, flashOn, flashOff). Perhpas I call it in the wrong moment, but I’ve tried alot… calling autoFocusOn befor init -> Exception, after Init and bevor Run -> nothing happens, after run -> nothing happens -> in a timer bevor grabbin an image -> nothing happens
On the Touch Pro I can’t test it, because I can not see the result in preview.
Can you tell us when the Demo-Version-Messagebox came up? If it would came up one time at start, it wouldn’t be a problem, but in my testcase it came up every time i click it away… so I can not realy see whats in the preview
thanks alot
December 27th, 2009 at 3:04 pm
Ok i bought HTC Touch Diamond2, and seems the best way to work with HTC devices directly with driver. i found HTCCamera.dll and it contain entry points:
Camera_Begin
Camera_Deinit
Camera_End
Camera_FlashLight
Camera_GetProperty
Camera_Init
Camera_SetProperty
P.S. to remove message box you can always buy sources
December 31st, 2009 at 7:16 pm
version 1.6.6.0 released:
1) HTC devices preview fixed
2) AutoFocus fixed
P.S. tested on Samsung i710, Toshiba Portage G910, HTC Touch2
P.P.S. Happy New Year
January 4th, 2010 at 4:36 pm
hello,
i’m having trouble getting directshownetcf to work with samsung i8000 omnia 2.
getMediaTypes returns resolutions in this format (without quotes):
“176X-144″
“768X-432″
after i click “start” in AMCameraTest i get garbage in the preview area. “show raw frame infp” says:
width: 176
height: -144
format: yv12
regards
January 4th, 2010 at 4:58 pm
What version of library? Whats about AMCameraEx?
January 4th, 2010 at 5:52 pm
directshownetcf 1.6.6.0
i have noticed that this problem only occurs in the last reported resolution on this device (768x-432)
and the fact that height is being reported as negative for all resolutions is not related to the problem because all other resolutions work fine.
amcameraex also displays garbage.
also i have noticed that there is a difference between directshownetcf version 1.6.6.0 vs 1.5.1.0 in reported resolutions:
1.6.6.0:
[0] “176X-144″
[1] “320X-240″
[2] “144X-176″
[3] “176X-176″
[4] “352X-288″
[5] “720X-480″
[6] “640X-480″
[7] “800X-480″
[8] “800X-450″
[9] “768X-432″
1.5.1.0:
[0] “640X480″
[1] “1280X960″
[2] “1600X1200″
[3] “800X480″
[4] “2048X1536″
[5] “2560X1920″
[6] “1280X768″
[7] “2048X960″
[8] “2560X1536″
[9] “2560X1440″
[10] “1920X1080″
[11] “800X450″
[12] “768X432″
January 4th, 2010 at 6:49 pm
2kamil, can you email me some screenshots? also will be great if you will grab some raw frames and email to me, hope it will help to fix this bug, as i dont have omnia 2 to fix it locally
January 5th, 2010 at 10:43 am
@admin: i will try to send them today.
i have another question: if i were to buy the sources are you publishing them on some sort of repository so we can easily track source code changes ? if not, would you think about it ?
January 5th, 2010 at 12:12 pm
Yes its possible to get sources from svn, if you will buy them i will provide you access
January 6th, 2010 at 2:45 pm
AMCamera - correct list of resolutions
AMCameraEx - wrong list of resolutions + negative vertical resoltion
AMCameraEx.saveJpeg( ) throws NotSupportedException
January 6th, 2010 at 2:48 pm
2kamil
AMCameraEx.saveJpeg( ) is not implemented… if you will be little bit more attentive you find that there is nothing about this method on this site for example!
January 6th, 2010 at 4:24 pm
@admin:
and how should i know if this exception means:
a) not implemented because it has to be implemented some other way for this specific device, but in general it works and people do not complain about it
b) not implemented because the interface is poor and the method just throws an exception
on a side note, i would not bring the matter of “attentiveness” when all we have here is a not-so-robust blog and not a full-blown forum. and the library lacks any documentation.
back on topic: i will try to send those screenshots/photos of the screen today or tomorrow.
January 6th, 2010 at 4:52 pm
all methods that implemented are listed on this page if you found any extra method that not listed there it means that this method in progress or postponed…
if you dont like library, blog so on… no body ask you to use it… so be kind to respect that someone spend his own time to do something, that you for example dont wanna do
January 6th, 2010 at 5:21 pm
@admin
i never said i “don’t like” the library. there is nothing to like or not to like.
i consider buying it because it would simplify the development of our application and that’s it. my respect to this piece of code would be expressed in dollars. i don’t have anything “against it” even if it is coded poorly in some areas or doesn’t have any proper documentation.
do you expect us to plow through all the comments every time we need some small piece of info regarding the library ? i asked a simple question and got accused of lack of attention. i responded that you can’t really blame people when you provide answers in such a “uncategorized” fashion - on a blog.
i am not writing this so we can possibly argue more but to get some answers/provide additional information about the behavior of your library on my end. and it seems like you misinterpreted my report (”AMCameraEx.saveJpeg( ) throws NotSupportedException”) like some kind of accusation.
have a pleasent rest of the day
January 6th, 2010 at 5:22 pm
Does it support WinCE?
How to Open my camera on port cis1?
When i run the sample on wince,show “camera not init”.
January 6th, 2010 at 5:57 pm
2kamil i just tired to answer for the same question every single day… I just ask you to take a look on list of methods that posted on library page (!) you dont have to check all blog comments just check methods that listed on library page… everything else are not implemented yet.
January 6th, 2010 at 5:57 pm
Can someone explain what the MMSWriter does exactly and if possible provide some sample code on how to use it?
January 6th, 2010 at 6:00 pm
2AlphaWu:
library works on WinCE but your camera driver should provide DirectShow interfaces. if it not provides i recommend you check camera sdk there definitely should be way to receive stream from camera using DeviceIOControl…
January 6th, 2010 at 6:03 pm
2Scrappy, i`ve already answered… check comment #151:
http://alexmogurenko.com/blog/directshownetcf/?cp=16#comment-319
January 6th, 2010 at 6:21 pm
@admin:
you assume that i know that everything not listed on this page is not yet implemented in the library.
perhaps starting a forum would save you some precious time
January 7th, 2010 at 9:44 am
I have a cameratest.exe,the camera manufacture provide.the program can preview the video.I think the DirectShow is work.
the library do nothing with the port :cis1? If I use DeviceIOControl,how integrated with the library.
Thanks.
January 7th, 2010 at 11:03 am
cameratest.exe does not mean that your camera provide directshow interface… so you have or disassemle cameratest.exe and check how it works with camera… or contact to manufacturer and ask for SDK or documentation!
January 7th, 2010 at 6:38 pm
yeah… I think it would be a good idea to have a support forum.
Your library is getting more and more popular. That’s good!
Thanks for your great work
January 8th, 2010 at 1:36 am
Ok, DirectShowNETCF moves to it own site:
http://directshownetcf.com
there you can find list of supported methods and forum
January 8th, 2010 at 2:27 pm
now that was FAST
January 12th, 2010 at 2:44 am
Thanks for adding the forum!
January 23rd, 2010 at 11:17 pm
DirectShowNETCF 1.7.3.0 Released:
1) PlayerControl Volume controling
2) PlayerControl real resolution detection
3) PlayerControl Balance controling
4) PlayerControl BitRate detecting (if possible)
5) PlayerControl resize on fly
January 28th, 2010 at 12:53 am
Announcement:
next week I`m going to release first version of HTCCamera class, this class will work with driver (nothing about directshow) as result it will allow to preview/grab high-resolution frames from HTC camera, correct control autofocus, flash so on!
Regards,
Alex
January 28th, 2010 at 11:24 pm
Thank you man!
This is really great, nice work!
February 1st, 2010 at 4:06 am
AMCameraEx do not work on Omnia 2, but it is the only one that allow to rotate the screen.
February 1st, 2010 at 5:11 am
in Camera example the prevew is visible if captureType is set to “Preview” only (Omnia 2) but how can i set this in AMCameraEx?
February 1st, 2010 at 8:44 am
use forum for questions
http://directshownetcf.com/forum/
February 2nd, 2010 at 5:15 pm
how can I get audio’s information?
In previous version, there was a code about audio,
but in present version, there wasn’t….
February 5th, 2010 at 7:25 pm
Thanks for providing the HTCCamera class!! That’s great news!
February 11th, 2010 at 5:57 pm
Firstly thanks for the library. Excellent work.
in DirectShowNETCF.Camera.AMCameraEx or DirectShowNETCF.Camera
which method can I call to access the front camera.
I mean is there a method or property where I can set which camera (front or back) to use before grabbing a frame.
thanks in advance
Amit
February 14th, 2010 at 3:36 pm
2all, use forum if you got any questions
February 14th, 2010 at 3:36 pm
HTCCamera v1.0 released
February 20th, 2010 at 10:07 pm
Hello Alex, I just found your software tools. Got it running. Fantastic software. I want to use it in a software which checks special places in companies. With a SMS my program makes a shot and will send the picture to a server …
Can i use your DLLs free of charge?
Regards Peter Krohn
February 20th, 2010 at 10:29 pm
you can use Camera its free if you dont need sources… other classes you can use for free if you ok with messageboxes… otherwise you need to buy library
February 21st, 2010 at 2:10 am
Hi Alex
I have made great progress with your toolkit but I still have one problem.
I went to use AmcameraEX because I need to be able to init the camera at a certain rotation. I cant find any EX examples or code in your downloads. So how do I get the EX version running.
But I also see that the EX version doesnt have Jpeg save. So either I have the preview rotated correctly or I can save the image, but I cant have both?
Could you point me the right direction?
Thanks for all your help
Best Wishes
Richard
February 22nd, 2010 at 4:00 pm
Hi there,
first of all thank you for that great library. I tried to get the AMCameraEx-Class working, but on each try it says “CameraFilterError” can you please hint me what I am doing wrong?
Kind regards,
Markus
February 24th, 2010 at 9:38 am
2Markus & RichardT please use forum for questions:
directshownetcf.com/forum/
March 3rd, 2010 at 7:01 pm
I have a iPAQ 214. It has a Windows Mobile 6 Classic SO CE 5.2.1711 (Compilation 18165.0.5.0). Why DirectShowNETCF.Player does not work?
it always says to me “MediaFailed”.
Regards.
March 3rd, 2010 at 10:32 pm
Actually there i bug exist, so current version cannot play that wmp can i`m working on fix it, but if wmp cannot play some files on your device you then this is codes problem
March 7th, 2010 at 12:49 am
version 1.9.0.0 released, NullCamera added
March 7th, 2010 at 11:29 am
hello alex, at what currency are you selling your source code for?
March 7th, 2010 at 11:47 am
Hello Steve,
currency = US dollar, but we can always communicate (via email) if you got problems with it
March 23rd, 2010 at 5:33 pm
A few points
- The camera controls don’t work on my Sony Xperia X1a. I can’t Init() or Start() the camera for capture or preview.
- The product offerings are very confusing. It’s very difficult to tell what the differences are between all the products and what purchases include what products. A simple comparison chart would be very helpful.
March 23rd, 2010 at 10:41 pm
1. I`ve never ever heard about “Sony Xperia X1a” so i cannot say what exactly wrong there
2. You have examples so you can take them and compare
March 24th, 2010 at 11:18 am
Hello ¡¡
Thanks a lot for your job. I was looking for this information, but I’m not able to get my HP iPAQ 214 working with your directshownetcf.
I tried the player example but I get only a black screen. I can’t play audio and video. May be you can help me, perharps I have to install some aditional software in order to play movies in windows mobile 6 classic.
Thanks in advance,
Félix
March 24th, 2010 at 2:02 pm
Hello Feilx,
actually it should play everything that wmp (that one that on device) can play.
i did not upload newest version yet anyway it should play at least wmv files!
does any file playable by wmp that on device?
March 24th, 2010 at 3:32 pm
Thanks a lot for your reply.
¡¡ wmp plays wmv files without any problem ¡¡, but the player doesn’t play it.
Any suggestion will be recibed with a lot of expectation.
Thanks in advance,
Félix
March 24th, 2010 at 4:17 pm
i will upload new version today,
i had this problem on some devices but fixed it few month ago, just did not upload yet
March 25th, 2010 at 11:54 am
I’m looking forward for this new version ¡¡¡
Have you upload it?
Thanks a lot
Félix
March 25th, 2010 at 12:13 pm
Now I’m trying PlayerControlExample and I’m getting, when load the wmv video that I can play in wmp, a showmessage dialog “MediaFailed”
I expect you have the solution for this problem ¡¡
Thanks ¡¡
April 4th, 2010 at 12:29 am
version 2.0.0.0 released:
1) player control can play everything that wmp on device can
2) fixed “init” problem for all camera classes
3) some bugs in AMCameraEx fixed
April 6th, 2010 at 3:11 am
version 2.1.0.0 released:
1) AMCameraEx added new effect (CropOval)
2) AMCamera mixed with NullCamera (so you can use all AMCamera features without preview)
3) No more “demo” messageboxes
April 11th, 2010 at 11:10 am
Alex, what about implementing the OpenURL() functionality in Player and PlayerControl classes? Is that possible?
April 11th, 2010 at 1:16 pm
Already works
April 12th, 2010 at 11:44 am
I just tried to run PlayerControlExample on WM6 Pro VGA emulator with following lines replaced in Form1.cs:
private void button1_Click(object sender, EventArgs e)
{
playerControl1.OpenFile(”http://www.jhepple.com/SampleMovies/niceday.wmv”);
// All OpenFileDialog stuff is commented out
}
but getting a native exception when clicked Play button.
Is it emulator only problem (missing DirectShow filters?) or I’m doing something wrong?
P.S.: Example video used in code plays finely via Windows Media Player Mobile on emulator.
April 13th, 2010 at 4:50 pm
Sorry to ask this, not sure if it has been asked before…
I just downloaded the latest version and I saw that the file DirectShowNETCF.Native.dll is not included anymore. Is that file no longer needed?
Thanks
April 13th, 2010 at 5:45 pm
2galead: i never tryed library on emulator so i cannot be sure that it should work correct there. please check on real device
April 13th, 2010 at 5:48 pm
2JohnQ: yes, DirectShowNETCF.Native.dll is not included anymore
instead you should use
AMCameraEx.Native.dll - if you use AMCameraEx
AMCamera.Native.dll and NullRenderer.dll - if you use AMCamera
NullRenderer.dll - if you use NullCamera
April 19th, 2010 at 4:50 pm
seems that wmv is not working on a real device, avi, 3gp and mp4 plays fine but only locally, it seems to fail on http:// and mms:// then i get an exception 0xc0000005 0×02f81740 0×00000000 module quartz.dll Offset 0×0001b740
April 19th, 2010 at 6:15 pm
probably its my bug, i have to check it.
dies wmv play locally?
April 20th, 2010 at 5:22 am
Thanks, yes it just wont play wmv neither locally or remote, then i got the quartz.dll msg mentioned before the exception is exactly the same if i try to play mp4 and 3gp (these play fine locally) from a remote server
exception near iFileSourceFilter.Load then the demo dialog is also not popping up the app has died from there
while wmp on the same device plays wmv and also from remote locations
oh i just also noticed that mpg doesn’t play while it works using wmp on the device
April 23rd, 2010 at 11:08 pm
Demo Boxes continue apear in controls
April 25th, 2010 at 2:20 pm
2kike88, yes demo message box will be in PlayerControl until i implement own renderer
April 25th, 2010 at 2:23 pm
version 2.2.0.0 released:
1) AMCameraEx - added function fixPreview - some Tosiba/LG devices got wrong Chroma buffer ordering as result we got incorrect preview, fixPreview fixes this issue
2) AMCameraEx - fixed bug with overlaying images
3) AMCameraEx - added new function blendBitmap it allows to blend preview and required bitmap
May 6th, 2010 at 7:46 pm
Hi Alex,
Great job on this library!
I am running an MC55 and have two Questions:
1. When I run the CameraAM example (no compile, just direct copy from download and click “Start”) I get a message box that says “DemoVersion Experied”.
2. When I run the AMCameraGrab example I get an exception that says “Method not found: init() DirectShowNETCF.Camera.AMCamera.AMCamera ”
Any Ideas?
May 6th, 2010 at 8:07 pm
Alex,
A little more info. My MC55 had powered all the way down so the clock reset to 1/1/2007. I changed the clock to today 4/5/2010 and the “demo version” message box went away.
However, there is now a graphical overlay on the preview window that says “Demo Version”. It is a light blue semi-transparent square.
Any Ideas?
May 6th, 2010 at 10:19 pm
yes current version will work during may 2010 then it will crash application… and yes you will see demo blended image, if you want to remove it you should buy library
June 7th, 2010 at 2:30 pm
Has anyone got the camera functions to work on a WM 6.5 device?
When you try to call DirectShowNETCF.Camera.Camera.getMediaTypes() a blank list is returned….
June 7th, 2010 at 5:35 pm
i got, i dont do anything specific there… if it does not return mediatypes then there you doing something wrong or you device got poor driver
July 26th, 2010 at 12:53 pm
Hi,
DirectShowNETCF.Camera.Camera.getMediaTypes() return a blank list on HTC HD2, but works fine with other devices.
Any idea why ?
Regards
July 29th, 2010 at 10:22 pm
I am able to run simple demo of the application on my MC75/winmo 6.1 .Net 3.5, but when I integrate the same code into my production code I get a CameraFilterError when trying to call camera.init(false) on the AMCamera object. Any ideas?
July 29th, 2010 at 10:36 pm
Sorry, I just figured it out. Barcode scanner was initialized. After stoping the barcode scanner everything worked just fine.
July 31st, 2010 at 11:31 pm
Hello,
The video is showing with the AMCameraEx with my HTC HD2
Cannot get video with the Camera.
Can you also implement a function in AMCameraEx to save the data to a video file like avi or mpg ?
thx in advance
August 12th, 2010 at 1:00 pm
Hi Alex,
I’m trying your library. Is it possible to take a picture in high resolution ?
The picture saved are 640×480 while the camera has 3Mpixels.
Thank you in advance.
Kevin
August 12th, 2010 at 2:14 pm
Hey KCorazza,
yes i think its possible to grab frame with higher resolution but in this case you will need to connect samplegrabber to still pin instead preview