Quantcast
Viewing all 1079 articles
Browse latest View live

Capture Remote / IP Cameras using Media Foundation

Hello. I was, with the help of MFCaptureToFile sample, able to capture my HD camera using media foundation and rendered it's frames using Direct3D onto a dialog. I was wondering if there is a way to capture an IP camera? Will I use  MFCreateSourceReaderFromURL() with the ip address of camera? Thanks for any pointer

Using IMFSinkWriter and IMFSourceReader, how to store custom timestamp or tag with each frame as metadata?

Hello,

I need to store a custom timestamp per frame when encoding frames using IMFSinkWriter, to be later read in as attributes from the sample using IMFSourceReader. This is using the H264 encoder and Windows 8.

If not possible is there a sample ID, or any unique value that exists during encoding that can be read in later when decoding?

If this isn't possible, seems like an obvious way to extend the API in Windows 9, after all APIs is the reason why Windows still matters.

Thanks.

IMFSourceReader

Is it possible to control the number of samples read by IMFSourceReader?

Problem With Seek using an Media Foundation Decoder Transform

Hi,

I have written an Dummy MF decoder for decoding of MP4 contents. What i am doing is getting MP4 data from MF source transform from the topology and decoding the data using Directshow decoders and rendering it using EVR (Somewhere else where i wanna render)

When i seek then I have seen that MF Source transform is sending Audio and Video data with non matching timestamps due to which my Dshow graph is rendering out of sync.

I know here i should set some Prerolling flags and Discontinuity flags in my Dshow pipeline but My Q is I could get the Discontinuity flag but could not get the Prerolling flag in MF Decoder transform?

How to get that ... Please help ???

~ Richter

 

WASAPI Capturing sound loopback from another process

Hi,

I am writing an application that captures the video/audio of an application.

i would like to know if it is possible to capture the sound of a specific application (as in if application A and B are both playing sounds and i am capturing application A... i only want to receive the sound of application A)

cheers

Francois

Custom Topology Loader

Hi,

I want to use a custom topology loader and as I understand you just set the attribute MF_SESSION_TOPOLOADER on the media session: hr = attr->(MF_SESSION_TOPOLOADER, myTopoLoaderCLSID)

This will work if the class is registered because the media session calls CoCreateInstance etc.

But what can be done if the class is not registered?

Is there something similair to MFTRegisterLocal(...)?

best regards,

Carl

HELP!!! CANNOT SEE SAVED VIDEO FORMAT FILE FROM WINDOWS MEDIA PROFILE EDITOR IN MOVIE MAKER

Sorry that I had to use caps, but it's an emergency. Please answer......

Recompiling topoedit

I'm trying to recompile topoeditusing Visual Studio 2012 (RC, still got 42 days to use it).  

After VS2012 auto converted, the tedutil project would make successfully.  However, the topoedit project fails.

For example, I get five link errors, pasted into this post below the "----" separator.  I've investigated the first one, complaining that TEDGetAttributeListLength() is missing.  I see a reference to it in topoedit project's PropertyView.cpp. But I don't see how it's supposed to get it or why the link error occurs.  The project tedutil appears to make a dll.  I *did* regsvr32 the dll after I remade tedutil.  I'm ignorant about what else I might do.

Searching all the source, it seems like the unresolved external references must have something to do with the linker wanting to find the DLL and not finding it.  My knowledge in this area is pretty much two decades old and faded from my memory.

Please help!

Thanks.

----

1>PropertyView.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl TEDGetAttributeListLength(void)" (?TEDGetAttributeListLength@@YAKXZ) referenced in function "public: long __thiscall CPropertyEditWindow::OnAdd(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAdd@CPropertyEditWindow@@QAEJGGPAUHWND__@@AAH@Z)
1>PropertyView.obj : error LNK2019: unresolved external symbol "wchar_t const * __cdecl TEDGetAttributeName(unsigned long)" (?TEDGetAttributeName@@YAPB_WK@Z) referenced in function "public: long __thiscall CPropertyEditWindow::OnAdd(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAdd@CPropertyEditWindow@@QAEJGGPAUHWND__@@AAH@Z)
1>PropertyView.obj : error LNK2019: unresolved external symbol "unsigned short __cdecl TEDGetAttributeType(unsigned long)" (?TEDGetAttributeType@@YAGK@Z) referenced in function "public: long __thiscall CPropertyEditWindow::OnAdd(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAdd@CPropertyEditWindow@@QAEJGGPAUHWND__@@AAH@Z)
1>PropertyView.obj : error LNK2019: unresolved external symbol "enum TED_ATTRIBUTE_CATEGORY __cdecl TEDGetAttributeCategory(unsigned long)" (?TEDGetAttributeCategory@@YA?AW4TED_ATTRIBUTE_CATEGORY@@K@Z) referenced in function "protected: long __thiscall CPropertyAddDialog::OnCategoryChange(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnCategoryChange@CPropertyAddDialog@@IAEJGGPAUHWND__@@AAH@Z)
1>tedapp.obj : error LNK2019: unresolved external symbol _TEDCreateTopoViewer@16 referenced in function "protected: long __thiscall CTedApp::OnCreate(unsigned int,unsigned int,long,int &)" (?OnCreate@CTedApp@@IAEJIIJAAH@Z)



Interlaced source picture to progressive output picture.

I'm a complete noob to MF, please help me out.

I am capturing some legacy interlaced video (using Firewire), and encoding it using the H.264 encoder, into an MP4 file, using the sample project MFCaptureToFile. I would like to configure the MF so that the output H.264 picture is progressive. Can it be done?

As I understand, I must set the AVEncVideoOutputScanType property of the ICodecAPI to eAVEncVideoOutputScan_Progressive. How do I obtain the ICodecAPI from the IMFSinkWriter? Do I use the GetServiceForStream method? I tried, but I don't know what GUID to use for the second parameter.

I would like to enquire regarding about the Output Protection Manager.

Hi there,

I would like to enquire regarding about the Output Protection Manager.

I'm developing an application for applying HDCP

I was developed program refer to this web site. 

(OPM Example Code : http:// msdn.microsoft.com /en-us/library/windows/desktop/dd388945(v=vs.85).aspx)

I was finished "Performing the OPM Handshake".

But, I have any problem of compiler Link error.

This code is example code.
-----------------------------------------------------------------------------------------------------------
    OPM_CONFIGURE_PARAMETERS Command;
    ZeroMemory(&Command, sizeof(Command));

    Command.guidSetting = OPM_SET_PROTECTION_LEVEL;
    Command.ulSequenceNumber = uCommandSeq;
    Command.cbParametersSize = sizeof(OPM_SET_PROTECTION_LEVEL_PARAMETERS);
    CopyMemory(&Command.abParameters[0], (BYTE*)&CommandInput, Command.cbParametersSize);
-----------------------------------------------------------------------------------------------------------

Compier didn't found OPM_SET_PROTECTION_LEVEL.

error LNK2001: unresolved external symbol _OPM_SET_PROTECTION_LEVEL
fatal error LNK1120: 1 unresolved externals

I have include this header file ( opmapi.h).

But occur this link error.

Please help me.

I'll be looking forward to your reply.

Video with alpha channel ... comes out opaque

Hi,

   Got an uncompressed avi with ARGB frames, each with an alpha channel.

When I render this with media foundation, the frames are decoded, but the alpha seems to be ignored and the frames come out visible, but opaque.

Please could Microsoft supply a sample application that demonstrates video streams that include alpha channels decoding correctly.

Thank you.

Best regards,
Steve Williams
Advance Software

audio service not working

I hav hp laptop dv4t 1300 pavillion PC, my audio service not working, red touch screen button for volume wont change to green , what ot do

Capture H264 from C920 Problems

Hey all,

I am trying to capture the H264 stream from a Logitech C920. First I ran into an issue that the MediaType (IMFMediaType) was not visable via the GetAvailableDeviceMediaType method. With a bit of diggin I resolved this issue. Turns out it was Logitechs 'proprietary' driver that was hiding it from the user. After switching back to the UVC 1.5 driver i now get h64 Media types listed when enumerating the device.

My first issue is that no matter what media type I select and set using the below code, I always just receive the default output on the screen. My hunch is that I have absolutely no clue what I am supposed to be doing and am changing the wrong settings. I am running the CaptureEngine sample code that is provided in the Windows 8.1 SDK samples (can't link as I am un verified but a quick google search should get you there)

I have modified the Capture.cpp HRESULT CaptureManager::StartPreview() method as such:

HRESULT CaptureManager::StartPreview()
{
    if (m_pEngine == NULL)
    {
        return MF_E_NOT_INITIALIZED;
    }

    if (m_bPreviewing == true)
    {
        return S_OK;
    }

    IMFCaptureSink *pSink = NULL;
    IMFMediaType *pMediaType = NULL;
	DWORD pdwStreamCount = 0;
	DWORD dwMediaTypeIndex = 0;
	IMFMediaType *pMediaTypeTemp = NULL;
	IMFMediaType *pMediaTypeh264 = NULL;
    IMFMediaType *pMediaType2 = NULL;
    IMFCaptureSource *pSource = NULL;

    HRESULT hr = S_OK;
    
    // Get a pointer to the preview sink.
    if (m_pPreview == NULL)
    {
        hr = m_pEngine->GetSink(MF_CAPTURE_ENGINE_SINK_TYPE_PREVIEW, &pSink);
        if (FAILED(hr))
        {
            goto done;
        }

        hr = pSink->QueryInterface(IID_PPV_ARGS(&m_pPreview));
        if (FAILED(hr))
        {
            goto done;
        }

        hr = m_pPreview->SetRenderHandle(m_hwndPreview);
        if (FAILED(hr))
        {
            goto done;
        }

        hr = m_pEngine->GetSource(&pSource);
        if (FAILED(hr))
        {
            goto done;
        }

		//Written by Manu
		hr = pSource->GetDeviceStreamCount(&pdwStreamCount);
		if (FAILED(hr))
		{
			goto done;
		}

		//This will enumerate through all the availible sources. WORKS!
		for (int i = 0; i < pdwStreamCount; i++){
			dwMediaTypeIndex = 0;
			hr = S_OK;
			while (hr == S_OK){
				hr = pSource->GetAvailableDeviceMediaType(i, dwMediaTypeIndex, &pMediaTypeTemp);
				if (i == 0 && dwMediaTypeIndex == 196)
					hr = pSource->GetAvailableDeviceMediaType(i, dwMediaTypeIndex, &pMediaTypeh264); //Selects H264 1280x720 30FPS
				dwMediaTypeIndex++;
			}
			if (hr != S_OK && hr != MF_E_NO_MORE_TYPES)
			{
				goto done;
			}
		}

		// Configure the video format for the preview sink. This should set the default type to the selected above.
		hr = pSource->SetCurrentDeviceMediaType(0, pMediaTypeh264);
		if (FAILED(hr))
		{
			goto done;
		}

        // I test here what returns and I do not get back what I just set. That is most likely the issue.
		hr = pSource->GetCurrentDeviceMediaType(0, &pMediaType);
        if (FAILED(hr))
        {
            goto done;
        }

		// With the above result, I try to strong arm it into using H264 by using that type from now.
		hr = CloneVideoMediaType(pMediaTypeh264, MFVideoFormat_H264, &pMediaType2);
        if (FAILED(hr))
        {
            goto done;
        }

        hr = pMediaType2->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
        if (FAILED(hr))
        {
            goto done;
        }

        // Connect the video stream to the preview sink. Note that pMediaType2 is cloned from H264. Yet no matter what I set that to (resolution, format, ratio) nothing changes!
        DWORD dwSinkStreamIndex;
        hr = m_pPreview->AddStream((DWORD)MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_VIDEO_PREVIEW,  pMediaType2, NULL, &dwSinkStreamIndex);        
        if (FAILED(hr))
        {
            goto done;
        }
    }


    hr = m_pEngine->StartPreview();
    if (!m_fPowerRequestSet && m_hpwrRequest != INVALID_HANDLE_VALUE)
    {
        // NOTE:  By calling this, on SOC systems (AOAC enabled), we're asking the system to not go
        // into sleep/connected standby while we're streaming.  However, since we don't want to block
        // the device from ever entering connected standby/sleep, we're going to latch ourselves to
        // the monitor on/off notification (RegisterPowerSettingNotification(GUID_MONITOR_POWER_ON)).
        // On SOC systems, this notification will fire when the user decides to put the device in
        // connected standby mode--we can trap this, turn off our media streams and clear this
        // power set request to allow the device to go into the lower power state.
        m_fPowerRequestSet = (TRUE == PowerSetRequest(m_hpwrRequest, PowerRequestExecutionRequired));
    }
done:
    SafeRelease(&pSink);
    SafeRelease(&pMediaType);
    SafeRelease(&pMediaType2);
    SafeRelease(&pSource);

    return hr;
}

Follow my comments for the issue but basically no matter what I do I cannot change the output (occasionally I am able to break it!). I think I must be calling the wrong functions or doing something fundamentally wrong.

As a part two of this issue: My final goal is to stream this to RSTP (or any network video stream protocol). Is this a good starting point? Are there better approaches?

Cheers in advance!

Use camera from several apps at the same time


I'm using a camera and AVStream for the camera, the problem I encounter is that while one application is running the camera stream is caught and no other application can use it.

for example skype is running so my app that needs the camera cannot use the camera.

what is the best solution for this? are there any parameters/ configuration in the driver to enable multiple apps? I saw this http://msdn.microsoft.com/en-us/library/windows/hardware/ff554255(v=vs.85).aspx  will this help the situation I just described? 

can you point me to sample implementation? or do you have any other suggestions ?

Windows 8.1 - Video Capture Start->Stop->Start

There is a bug in Media Foundation on Windows 8.1.  It's simple to reproduce, including in Topoedit.

Steps... 

-Add a video capture source (we've tried several - including the AVStream Simulated Hardware Sample)

-Add a EVR

-Connect them

-Play/Run/Start (observe that you get video)

-Stop

-Play/Run/Start (observe that you don't get video)

This was not a problem with Window 8.0.  


send and capture midi through network

Hi,

I would like to be able to send a midi call from one computer (client) to another computer (server) on the same wifi network. If this can't be directly transferred in the network, I would like to create a host software on the server that sends a midi call to the midi interface (or any local midi driver). Can this be done?
Maybe the picture help out understanding what I want.

Best regards
/Magnus
Image may be NSFW.
Clik here to view.

PCM 16bit Sample Value 0x8000 on Media Foundation

The PCM audio sample values are SWORD (=2 bytes) of size.  signed int. Range -32768 ... +32767

All ok all on values of  -32767 .. +32767   

But on MF the MediaBuffer retreived by IMFSourceReader.ReadSample sometimes contains  a 0x8000 value in PCM buffer

On PCM in the past that value was always = -32768. (WavEditors show it as -1.0)

But if this value (occured on MF) is not changed into zero =0  then  on playback that wave data

audio causes distorted audio click sounds. Changing it to zero is ok.  but it slows performance of audio actions.

Is there a MF Media Flag / Attribute to avoid this  problem?

MediaFoundation blog

Hello.

MF blog

Last post is 20 Jan 2011...

What's new with MF ?

What about the future of MF ?

Where are you MediaFoundation developpers ? What are you doing ?




i need to replace the selected frames form the video

for my steganography project i need to replace the selected frames with the embedded frames...so i need help or any suggestion .... thanks

replacing the frames in the video with the embedded fames

for my steganography project i need to replace the original frames of the video with the embedded frames...any help regarding this issue ..... ??
Viewing all 1079 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>