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

Download Library and Examples

P.S:

If you need sources of library you can Buy it

233 Responses to “DirectShow.NETCF”

  1. 1
    cHRIS Says:

    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!

  2. 2
    admin Says:

    GetGrayScale works only on YUV formats, on Rgb565 it should return false!

    P.S. it aint problem to implement for RGB formats

  3. 3
    cHRIS Says:

    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!

  4. 4
    admin Says:

    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]

  5. 5
    cHRIS Says:

    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?

  6. 6
    admin Says:

    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

  7. 7
    cHRIS Says:

    i would post source, but I haven’t changed anything in your example, I just compiled and run. Anyway, i will investigate further.

  8. 8
    admin Says:

    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

  9. 9
    cHRIS Says:

    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.

  10. 10
    admin Says:

    can you save raw data file and email it to me? also please email frame format (width, height, fixiel format)

  11. 11
    cHRIS Says:

    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 :) !!!

  12. 12
    Marche Says:

    Nice library, I tested it and works great.
    Do you plan to support flash for camera?

    Thank you

  13. 13
    admin Says:

    Yes, sure… one day i will add it

  14. 14
    Pet Says:

    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?

  15. 15
    Marche Says:

    Hi sasha ;) the library doesn’t work in CF 3.5.

  16. 16
    admin Says:

    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

  17. 17
    Pet Says:

    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!

  18. 18
    admin Says:

    ah, ok… will add it in next build (when found whats wrong with net cf 3.5)

  19. 19
    admin Says:

    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

  20. 20
    Makt Says:

    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

  21. 21
    Mike Murray Says:

    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.

  22. 22
    Marche Says:

    Thank you again Alex.
    Testing it right now.

    Have a nice day! :)

  23. 23
    admin Says:

    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)?

  24. 24
    Pet Says:

    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?) .

  25. 25
    admin Says:

    Seems like thats normal situation for HTC devices :(

  26. 26
    Mike Murray Says:

    I need to receive and play stream from internet. What is a push source filter and where can I find one?

    Thank you.

  27. 27
    admin Says:

    I think you should implement filter because any filter for windows mobile its a rare thing

  28. 28
    Mike Murray Says:

    Do you have an links to show how to create a DirectShow filter compatible with Windows Mobile?

  29. 29
    admin Says:

    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

  30. 30
    Pet Says:

    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

  31. 31
    admin Says:

    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

  32. 32
    Howler Says:

    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.

  33. 33
    Howler Says:

    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.

  34. 34
    nemo Says:

    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);

  35. 35
    jd Says:

    hi alex, how can i create a nullrenderer filter as I know it is not supported in your current version of the DirectShowNETCF library.

  36. 36
    admin Says:

    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++

  37. 37
    Marche Says:

    Hi Alex
    Can you give an example on how to activate the flash? :)

    Thank you

  38. 38
    mav Says:

    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?

  39. 39
    admin Says:

    the problem that on my (samsung i710) nothing about flash so i cant even test, but may be will add it soon untested

  40. 40
    Jane Says:

    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?

  41. 41
    Sting Says:

    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();
    }

    }
    }

  42. 42
    admin Says:

    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

  43. 43
    Sam Says:

    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

  44. 44
    Steve Says:

    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??

  45. 45
    LEE Says:

    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.

  46. 46
    admin Says:

    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

  47. 47
    Igor Says:

    I have a HTC HD, that has two cameras.
    How can I detect them with the library ?

  48. 48
    jd Says:

    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.

  49. 49
    admin Says:

    You have to put it on device (folder where exe placed)

  50. 50
    jd Says:

    I’ve got it, problem resolved. thanks alex :)

  51. 51
    admin Says:

    Added methods flashOn and flashOff to Camera and AMCamera classes
    P.S. methods untested

  52. 52
    Rob Says:

    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.

  53. 53
    pacala Says:

    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

  54. 54
    Ready4Fajir Says:

    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 ?

  55. 55
    admin Says:

    GetClientRect

  56. 56
    Ready4Fajir Says:

    @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)

  57. 57
    SteveW Says:

    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#.

  58. 58
    admin Says:

    SteveW i think that you should read some C# books to understand it

  59. 59
    stevew Says:

    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

  60. 60
    admin Says:

    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…

  61. 61
    Dany Says:

    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…

  62. 62
    Ot Says:

    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

  63. 63
    Marche Says:

    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.

  64. 64
    admin Says:

    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

  65. 65
    Ravi Ranjan Kumar Says:

    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.

  66. 66
    Frank Says:

    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

  67. 67
    Jose Says:

    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

  68. 68
    admin Says:

    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

  69. 69
    Jose Says:

    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!!

  70. 70
    Andre Gomes Says:

    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.

  71. 71
    LuKu Says:

    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…

  72. 72
    Ruch Says:

    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

  73. 73
    Ruch Says:

    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

  74. 74
    hibbert Says:

    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

  75. 75
    Tige Says:

    Thanks for this lib. But why the preview video is so slowly?It’s much more slower than the camera program in mobile system.

  76. 76
    Windows Mobile - Bitmap vom Panel - Handy, PDA & mobile Welt @ tutorials.de: Forum, Tutorial, Anleitung, Schulung & Hilfe Says:

    […] Windows Mobile - Bitmap vom Panel […]

  77. 77
    admin Says:

    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

  78. 78
    LuKu Says:

    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…

  79. 79
    admin Says:

    2LuKu seems like was small bug, i uploaded fixed version

  80. 80
    hibbert Says:

    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

  81. 81
    LuKu Says:

    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…

  82. 82
    hibbert Says:

    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 =)

  83. 83
    kha Says:

    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.

  84. 84
    admin Says:

    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

  85. 85
    kha Says:

    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.

  86. 86
    kha Says:

    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.

  87. 87
    admin Says:

    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

  88. 88
    kha Says:

    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.

  89. 89
    admin Says:

    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

  90. 90
    kha Says:

    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. :D
    BTW thanks for your help.

  91. 91
    admin Says:

    device settings are not applicable to directshow, so it doesnt metter what you see in settings

  92. 92
    kha Says:

    hi Alex, sorry i has mistake in QVGA (240×320). thank you.

  93. 93
    hibbert Says:

    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

  94. 94
    admin Says:

    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

  95. 95
    John Says:

    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.

  96. 96
    admin Says:

    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 :)

  97. 97
    admin Says:

    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

  98. 98
    kha Says:

    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

  99. 99
    admin Says:

    samsung i710 works perfect

  100. 100
    John Says:

    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

  101. 101
    admin Says:

    Thank you John

  102. 102
    Rainchild Says:

    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.

  103. 103
    hibbert Says:

    Hi Admin.
    I have streched the image in the pictutebox and it is rotated for 180°.

    hibbert

  104. 104
    admin Says:

    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 :)

  105. 105
    Steve Says:

    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?

  106. 106
    admin Says:

    I havent check player class since like august 2009, but you can email me file which crashes example and i will check

  107. 107
    Steve Says:

    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.

  108. 108
    admin Says:

    i mean not example application, i mean file that yuo trying to play

  109. 109
    Steve Says:

    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.

  110. 110
    Sensifire Says:

    Hi, Alex
    Any news of the 180º rotation bug? Thank you

  111. 111
    admin Says:

    i`m not sure is it bug or feature, anyway i work on another part

  112. 112
    RichardT Says:

    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

  113. 113
    admin Says:

    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

  114. 114
    Chris Says:

    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

  115. 115
    admin Says:

    getTargetedImage not even in methods list, remove that part of code

  116. 116
    Luis Says:

    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

  117. 117
    admin Says:

    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

  118. 118
    Luis Says:

    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

  119. 119
    admin Says:

    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

  120. 120
    CarlB Says:

    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

  121. 121
    admin Says:

    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

  122. 122
    howard Says:

    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 ~

  123. 123
    admin Says:

    2howard, not yet, maybe one day…

  124. 124
    CarlB Says:

    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?

  125. 125
    admin Says:

    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…

  126. 126
    admin Says:

    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

  127. 127
    Richard Says:

    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

  128. 128
    Diego Says:

    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

  129. 129
    admin Says:

    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

  130. 130
    admin Says:

    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

  131. 131
    Diego Says:

    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

  132. 132
    admin Says:

    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

  133. 133
    admin Says:

    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

  134. 134
    kamil Says:

    is there a history of changes in each version available ?

  135. 135
    admin Says:

    to kamil, nope, but if its important i can start it with new version

  136. 136
    kamil Says:

    @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

  137. 137
    admin Says:

    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

  138. 138
    LEM Says:

    Just to say thanks for this great new version!

  139. 139
    admin Says:

    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

  140. 140
    CarlB Says:

    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 ;-)

  141. 141
    jangyoun Says:

    i need movie file such as avi….

    what shall I do?

  142. 142
    admin Says:

    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

  143. 143
    admin Says:

    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

  144. 144
    admin Says:

    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

  145. 145
    diego Says:

    Hello. Question: Why do I get green on AMCameraEx?.

    thanks
    Diego

  146. 146
    admin Says:

    2Diego, i dont know, probably problem with conversion.
    what exactry device? whats frame format, width, height returns AmCamera?

  147. 147
    Diego Says:

    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

  148. 148
    Diego Says:

    Hello, how are you?, A question: Why can not operate the autofocus ()?

    thanks.
    Diego

  149. 149
    admin Says:

    2Diego,
    autofocus aint work on HTC (at least in directshow)
    resolution the same problem…

  150. 150
    Scrappy Says:

    What does the MMSWriter do? Can someone supply some sample code on how to use it?

  151. 151
    admin Says:

    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

  152. 152
    admin Says:

    Announcement:
    next build will contain workable flash and autofocus for HTC devices! ;)

  153. 153
    admin Says:

    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 :)

  154. 154
    CarlB Says:

    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

  155. 155
    admin Says:

    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 :)

  156. 156
    admin Says:

    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 :)

  157. 157
    kamil nowicki Says:

    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

  158. 158
    admin Says:

    What version of library? Whats about AMCameraEx?

  159. 159
    kamil nowicki Says:

    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″

  160. 160
    admin Says:

    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

  161. 161
    kamil nowicki Says:

    @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 ?

  162. 162
    admin Says:

    Yes its possible to get sources from svn, if you will buy them i will provide you access

  163. 163
    kamil nowicki Says:

    AMCamera - correct list of resolutions
    AMCameraEx - wrong list of resolutions + negative vertical resoltion

    AMCameraEx.saveJpeg( ) throws NotSupportedException

  164. 164
    admin Says:

    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!

  165. 165
    kamil nowicki Says:

    @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.

  166. 166
    admin Says:

    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

  167. 167
    kamil nowicki Says:

    @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

  168. 168
    AlphaWu Says:

    Does it support WinCE?

    How to Open my camera on port cis1?
    When i run the sample on wince,show “camera not init”.

  169. 169
    admin Says:

    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.

  170. 170
    Scrappy Says:

    Can someone explain what the MMSWriter does exactly and if possible provide some sample code on how to use it?

  171. 171
    admin Says:

    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…

  172. 172
    admin Says:

    2Scrappy, i`ve already answered… check comment #151:
    http://alexmogurenko.com/blog/directshownetcf/?cp=16#comment-319

  173. 173
    kamil nowicki Says:

    @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

  174. 174
    AlphaWu Says:

    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.

  175. 175
    admin Says:

    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!

  176. 176
    Star Says:

    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

  177. 177
    admin Says:

    Ok, DirectShowNETCF moves to it own site:
    http://directshownetcf.com

    there you can find list of supported methods and forum

  178. 178
    kamil nowicki Says:

    now that was FAST :)

  179. 179
    Star Says:

    Thanks for adding the forum!

  180. 180
    admin Says:

    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

  181. 181
    admin Says:

    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

  182. 182
    2fast Says:

    Thank you man!

    This is really great, nice work!

  183. 183
    Juan Pablo Says:

    AMCameraEx do not work on Omnia 2, but it is the only one that allow to rotate the screen.

  184. 184
    Juan Pablo Says:

    in Camera example the prevew is visible if captureType is set to “Preview” only (Omnia 2) but how can i set this in AMCameraEx?

  185. 185
    admin Says:

    use forum for questions
    http://directshownetcf.com/forum/

  186. 186
    lee Says:

    how can I get audio’s information?

    In previous version, there was a code about audio,

    but in present version, there wasn’t….

  187. 187
    John Says:

    Thanks for providing the HTCCamera class!! That’s great news!

  188. 188
    cpda Says:

    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

  189. 189
    admin Says:

    2all, use forum if you got any questions

  190. 190
    admin Says:

    HTCCamera v1.0 released

  191. 191
    Peter Krohn Says:

    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

  192. 192
    admin Says:

    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

  193. 193
    RichardT Says:

    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

  194. 194
    Markus Says:

    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 :)

  195. 195
    admin Says:

    2Markus & RichardT please use forum for questions:
    directshownetcf.com/forum/

  196. 196
    Charlos Says:

    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.

  197. 197
    admin Says:

    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

  198. 198
    admin Says:

    version 1.9.0.0 released, NullCamera added

  199. 199
    steve Says:

    hello alex, at what currency are you selling your source code for?

  200. 200
    admin Says:

    Hello Steve,

    currency = US dollar, but we can always communicate (via email) if you got problems with it

  201. 201
    marck Says:

    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.

  202. 202
    admin Says:

    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

  203. 203
    Féilx Says:

    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

  204. 204
    admin Says:

    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?

  205. 205
    Félix Says:

    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

  206. 206
    admin Says:

    i will upload new version today,
    i had this problem on some devices but fixed it few month ago, just did not upload yet

  207. 207
    Félix Says:

    I’m looking forward for this new version ¡¡¡

    Have you upload it?

    Thanks a lot

    Félix

  208. 208
    Félix Says:

    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 ¡¡

  209. 209
    admin Says:

    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

  210. 210
    admin Says:

    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

  211. 211
    galead Says:

    Alex, what about implementing the OpenURL() functionality in Player and PlayerControl classes? Is that possible?

  212. 212
    admin Says:

    Already works

  213. 213
    galead Says:

    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.

  214. 214
    JohnQ Says:

    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

  215. 215
    admin Says:

    2galead: i never tryed library on emulator so i cannot be sure that it should work correct there. please check on real device

  216. 216
    admin Says:

    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

  217. 217
    yama Says:

    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

  218. 218
    admin Says:

    probably its my bug, i have to check it.
    dies wmv play locally?

  219. 219
    yama Says:

    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

  220. 220
    ''kike88 Says:

    Demo Boxes continue apear in controls

  221. 221
    admin Says:

    2kike88, yes demo message box will be in PlayerControl until i implement own renderer

  222. 222
    admin Says:

    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

  223. 223
    John Says:

    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?

  224. 224
    John Says:

    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?

  225. 225
    admin Says:

    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

  226. 226
    Chris Says:

    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….

  227. 227
    admin Says:

    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

  228. 228
    Stéphane Says:

    Hi,

    DirectShowNETCF.Camera.Camera.getMediaTypes() return a blank list on HTC HD2, but works fine with other devices.

    Any idea why ?

    Regards

  229. 229
    bobpf Says:

    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?

  230. 230
    bobpf Says:

    Sorry, I just figured it out. Barcode scanner was initialized. After stoping the barcode scanner everything worked just fine.

  231. 231
    Nicholas Says:

    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

  232. 232
    KCorazza Says:

    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

  233. 233
    admin Says:

    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

Leave a Reply