Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all 1079 articles
Browse latest View live

IMFSourceReader and MFVideoFormat_NV12 subtype

$
0
0

I'm trying to get the RGB frames from a video using the IMFSourceReader, all works fine so far; but I've noticed the frame format returned by the IMFSample interface when the output subtype is MFVideoFormat_NV12 does not correspond with the description given in the documentation on:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd206750%28v=vs.85%29.aspx

and actually corresponds to the YV12 format given on the same page.

That is, the NV12 data returned does not have the interleaved UV and channels, but instead has the halfsize U block and then the halfsize V block.

Just to be clear: this isn't a problem as I can handle both formats, but I'd like to know whether this a peculiarity of my machine or a consistent inconsistency(!) for when the software is deployed.

I'm running windows 7. MF_SDK_VERSION 0x0002 and MF_API_VERSION 0x0070


Rendering Audio Samples with Media Foundation

$
0
0

Hello,

I am wanting to render out audio from a micraphone via an IMFSample in Media Foundation, I have spent days on trying to figure out how to do this, I have looked at the MSDN docs for media foundation and they are not that helpful.

Currently I am capturing the audio device with MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID then I am creating an IMFSourceReader via the IMFActivate of the capture object, I am reading the samples asynchronously in OnReadSample via the IMFSourceReaderCallback.

I then enumerate an audio output device via:

hr = pEnum->EnumAudioEndpoints(eRender, eMultimedia, &pDevices);

and create an audio renderer with the following:

hr = MFCreateAudioRenderer(pAttributes, &m_pAudioSink);

I never hear anything at the endpoint even though OnReadSample is generating data.

I also tried the following:

IMFActivate* pActivate = MadNull;
    hr = MFCreateAudioRendererActivate( &pActivate );

    hr = MFCreateTopology( &m_pTopology );

    IMFPresentationDescriptor* pPresDesc = MadNull;
    hr = m_pMediaSource->CreatePresentationDescriptor( &pPresDesc );
    
    BOOL bSelected = FALSE;
    IMFStreamDescriptor* pStreamDesc = MadNull;
    hr = pPresDesc->GetStreamDescriptorByIndex( 0, &bSelected, &pStreamDesc );

    IMFTopologyNode* pSourceNode = MadNull;
    IMFTopologyNode* pOutputNode = MadNull;

    hr = MFCreateTopologyNode( MF_TOPOLOGY_SOURCESTREAM_NODE, &pSourceNode );

    hr = pSourceNode->SetUnknown( MF_TOPONODE_SOURCE, m_pMediaSource );

    hr = pSourceNode->SetUnknown( MF_TOPONODE_PRESENTATION_DESCRIPTOR, pPresDesc );
    hr = pSourceNode->SetUnknown( MF_TOPONODE_STREAM_DESCRIPTOR, pStreamDesc );

    DWORD stream_id;
    GUID major_type = GUID_NULL;
    IMFMediaTypeHandler* pHdlr = MadNull;
    hr = pStreamDesc->GetStreamIdentifier( &stream_id );
    hr = pStreamDesc->GetMediaTypeHandler( &pHdlr );
    hr = pHdlr->GetMajorType( &major_type );

    hr = MFCreateTopologyNode( MF_TOPOLOGY_OUTPUT_NODE, &pOutputNode );
    

    hr = pOutputNode->SetObject( pActivate );

    hr = m_pTopology->AddNode( pSourceNode );
    hr = m_pTopology->AddNode( pOutputNode );

    hr = pSourceNode->ConnectOutput( 0, pOutputNode, 0 );

    hr = pActivate->SetString( MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID, wstrID );

    if( SUCCEEDED( hr ) )
    {
        hr = MFCreateMediaSession( MadNull, &m_pSession );

        hr = m_pSession->SetTopology( 0, m_pTopology );
        hr = m_pSession->Start(&GUID_NULL, MadNull);
    }

I still got nothing from that......

All I want to do is send the samples generated from the sourcereader to the audio output device.

Cheers

MFCreateSourceReaderFromByteStream() fails with about 60 IMFSourceReaders open on Windows 7

$
0
0

In Firefox we now use WMF for playback of HTML5 audio and video on Windows. We have an IMFByteStream implementation that connects to our network stack, and we use the IMFSourceReader to demux and decode samples for playing in our existing rendering pipeline.

The problem is that if we try to open lots (60+) IMFSourceReaders for basic AAC/MP4 files at once, the call to MFCreateSourceReaderFromByteStream() starts to fail. This is actually not an uncommon use case; many HTML5 games create a lot of <audio> elements to preload their sounds.

So my question is, is it possible to get around this ~60 IMFSourceReader limit?

This problem only exists on Windows 7. It is fixed on Windows 8.

So, I presume we're hitting some kind of internal resource contention/limit inside MF.

It looks like MF is creating at least one work queue/thread per IMFSourceReader created. I tried to limit this by creating a single work queue, getting the decoders and MediaSource out of the reader and calling IMFRealTimeClient::SetWorkQueue() on them, passing in the ID of the shared work queue that I created. I hoped that would make all the Reader's sources/decoders use the same work queue, but that didn't seem to have any effect on the number of work queues/threads created. Is there something I'm not doing here? Or does the MP4Source and the AACDecoder ignore the SetWorkQueue() command?

Anybody got any other ideas how to solve this?

Recompiling topoedit

$
0
0

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)


making video converter/editor in Media Foundation (or any other VS package)

$
0
0

I was wanting to make a video converter than can convert between different video formats, especially AVCHD to mp4 and give any resolution I want, or to clip the frame at certain points wherever I want (like to convert wide screen video to regular screen and clip the sides, or to convert regular to wide and clip the top or add padding on the sides).  I also wanted to be able to create subtitles that support unicode by altering the frames of the videos and inserting unicode text using installed fonts in the system fonts folder.  Is this the kind of program that would be best to do in Media Foundation or some other package in Visual Studio?  Does Media Foundation support direct manipulation of the files in an abstracted way, or if I wanted to do this kind of thing, would I have to research and find out exactly how these formats store data and use binary file read write or some such technique and thus have to go through the difficulty of learning complicated compressed storage formats?  Also, would this kind of thing be possible in any C# package (I found out that Media Foundation is only in C++) or will I have to use Media Foundation with C++ if I want to do this in .NET? 

is mms supported over Media Foundation?

$
0
0

hi,

I am running Media foundation sample example MFPlayer to render the URL mms://.

this is getting failed with error code MF_E_INVALIDMEDIATYPE. 

In GetMajorType of this Sample, type is coming as MFMediaType_Image instead of MFMediaType_Video.

1.   Any reason why it coming as MFMediaType_Image even it is a video file?

2. If it come as MFMediaType_Image, how to handle it? I have tried using same code what

it is using for rendering video but got failed with ERROR 0xc00d5214 (MF_E_TOPO_UNSUPPORTED).

3. If I play same mms:// in wmplayer, it does not use Media Foundation, it uses direct show to play the same. in direct show it uses wmrender source filter which i cant use as there is no information how to use that. What actually this wmrender source filter does? How can I use/create the same in my application?

4. I tried using topoedit for rendering the same. it throws error stating Invalid media type. I  have read MMS protocol is supported in media Foundation (http://msdn.microsoft.com/en-us/library/windows/desktop/aa965244%28v=vs.85%29.aspx), than why it is getting failed in topoedit?

Please help me out for my doubts.

Best Regards,

Sharad

10 and 16 bit per channel color support in EVR

$
0
0

Does EVR support 10 or 16 bit color formats such as Y216, Y210, Y416, or Y410?  Does it require hardware support from the video card? Assuming that the video card supports it, is it possible to hook up a monitor that supports 10 or 16 bits per channel and have a totally 10 or 16 bit rendering pipeline?

Thanks.

How to Use IWMPNetwork Methods in a C++ Program

$
0
0

I'm writing a simple C++ program that should launch a video in Windows Media Player, then retrieve statistics about the video.

The program successfully uses the IWMPCore method launchURL and media player starts up and begins to run the desired video.

I then try to use the IWMPNetwork get_receivedPackets method, but this is returning S_FALSE.

I then try to use the IWMPControls stop method but this returns NS_S_WMPCORE_COMMAND_NOT_AVAILABLE.

The video is still playing when these methods are invoked.

Here is a section of my code:

IWMPControls *mpControlMethods;
IWMPNetwork  *mpNetworkMethods;

// code omitted for brevity...

hr = my_Player->launchURL (my_URL);

hr = my_Player->get_controls (&mpControlMethods);
hr = my_Player->get_network  (&mpNetworkMethods);

hr = mpNetworkMethods->get_receivedPackets (&my_receivedPackets);

hr = mpControlMethods->stop ();

Does anyone have any ideas on how to get this work, or maybe a code example of their own that I can try?


How to generate an MP4 file incluiding an audio stream of DolbyDigitalPlus(DDP or EAC3)?

$
0
0

Hi All,

I want to know how to generate an MP4 file that must have an H.264/AVC stream and a DDP(EAC3) stream.

The input sources are YUV file and PCM file.

Is it possible? if it's possible, please explain its design or show me an example code.

I tried this with IMFSinkWriter. But it was failure (MF_E_TOPO_CODEC_NOT_FOUND), when the SinkWriter is initializing.

If there is somebody know this problem, please help me.

Thank you...




IMFSinkWriter: WriteFrame returns E_CHANGED_STATE when encoding H.264

$
0
0

(Note: I originally posted this question in the Windows Apps with C++ forum about 3 weeks ago, but received no replies. I realized quickly that this might be a better forum for this, but wanted to let that question run its course before posting again here. So any help you all could provide would be VERY much appreciated.)

I am using a C++/CX component to encode video using IMFSinkWriter, and everything works fine when I encode using the WMV3 codec, but when I try to use the H.264 codec I get E_CHANGED_STATE (0x8000000c: "A concurrent or interleaved operation changed the state of the object, invalidating this operation.") errors. I can't find any reason to believe this is a threading issue, which was my first thought: the component is being called from an async/await C# method, but everything awaitable is being awaited, as far as I can see, and there's no other threading-like behavior going on in the app.

My second thought was that somehow the sink writer's throttling (on by default) was being turned off. But this doesn't seem to be the case. In fact, I tried to explicitly enable throttling, but this didn't have any effect:

spAttr->SetUINT32(MF_SINK_WRITER_DISABLE_THROTTLING, false);

The encoding source is an RGB32 stream, and I am encoding at a 1.5Mbps bitrate, 25 FPS.

The error happens every time I try to encode a video of any real-world length: it'll usually pop up before it gets about 10% of the way through a 5 minute output file. However, it isn't entirely deterministic: sometimes it will get partway through the third (of 58) segments, while other times it will happened on the first.

None of these problems affect WMV encoding. Can anyone offer any suggestions for things to try?

Additional note: I have seen some references that I might need to supply some metadata (a sample description box) with the video, but I can't find any documentation on this that I can understand. As indicated I can encode WMV without getting this error (usually-- I think I've seen it once or twice in the long history of testing this component), and all I would like to do is provide an alternative format for my users. Could the lack of this metadata be causing this, and if so are there any accessible tutorials on constructing it?

IMFMediaEvent::GetStatus Error code

$
0
0

Hello, all.

I'm tried that MPEG1Source sample, and i used BasicPlayback sample. 

MPEG1Source is successfully, but BasicPlayback sample still can't play .mpg files.

This problem occurred 'hr = pEvent->GetStatus(&hrStatus);'.

hrStatus value is 0xc00d5212, and there is error code.

But, i can't find that error code's mean, and why this occurred.

Please help me.

Writing metadata and text stream via IMFSinkWriter?

$
0
0

We are working on an application that supports saving video files into ASF and MP4 containers, via Media Foundation.

Our question is, how to write text stream (subtitle) and metadata to these containers? As far as we know, both container supports those types of data but found no way to write them. Also, no any example code found.

Is there a way to query some kind of interface from IMFSinkWriter that provides that functionality, maybe?

Sorry if it's very basic, but we really couldn't figure it out so far.

Thanks!


Where is the Windows Media Player SDK exactly ??

$
0
0

Hi out there,

I'm not sure whether this is the right forum, but maybe someone can help me find it.

I'm planning to develop a WMP 12 video-dsp plugin. I want to use the video-dsp plugin sample as a starter.

My environment is as follows:

Windows 8, Visual Studio express for desktop installed and running, Windows SDK installed. All updates installed.

I've read the web pages about the WMP SDK forth and back. Everything sounds fine.

I've learned that the WMP 12 SDK is in the Windows SDK.  I looked through all the Windows SDK subdirectories. But I can't find it.

I want to use the video-dsp plugin sample. But I can 't find.

I contacted the escde hotline. But didn't get any answer until today.

Any help would be appreciated.

Where are all these things ???

Thanks in advance,

Rolf-Dieter.

Hello out there...

It's now 14 days ago that I asked where the Video Player SDK exactly is.

Nobody knows ???

Thanks.

Best regards,

Rolf-Dieter.


RGBA ( source ) to BGRA ( WMF / DSHOW )

$
0
0

Hi,

is there a reason why the uncompressed RGB32 formats in WMF and DSHOW are BGRA in memory while outside there are lot of commonly used RGBA formats like in DXGI ? And is there any possibilty to alter a Media Type GUID so that we are able to use DXGI_FORMATs which have RGBA order with the WMF Sink Writer ?

I managed to swap channels with some memcpy, _rotr and bitshift operations. However...my real time capture of a BackBuffer is droping now 20 Frames instead of my usual 5.

I can write a custom GUID like this:

GUID VIDEO_INPUT_FORMAT = MFVideoFormat_Base;

VIDEO_INPUT_FORMAT.Data1 = D3DFMT_A8R8G8B8;  // this works while D3DFMT_A8B8G8R8 is not

As you can can see from this link http://msdn.microsoft.com/en-us/library/windows/desktop/cc308051(v=vs.85).aspx, it says that some D3DFORMATs are mappable to a DXGI_FORMAT, is it also possible backward from DXGI to D3D ? Only a few of the D3DFORMATs are working, D3DFMT_A8B8G8R8 fails for example. The Problem is that i have RGBA channel order ( in DXGI the format name and the memory are in same order, it is reversed in D3D9 ), but i can only set MFVideoFormat_RGB32 or D3DFMT_A8R8G8B8 / D3DFMT_X8R8G8B8 as my input.

Are only these D3DFORMATS meantioned here http://msdn.microsoft.com/de-de/library/windows/desktop/aa370819(v=vs.85).aspx are working ?

Main question is, why DSHOW and WMF have BGRA channel order in memory ( on their uncompressed RGB32 format ) as u can see here  http://msdn.microsoft.com/en-us/library/ms787838(VS.85).aspx , but some commonly used DXGI_FORMATS have RGBA. Was it expected that in future people would only use MFCreateDxgiSurfaceBuffer and add the buffer to a sample which can be encoded ( even though its only supported from Windows 8 and not below ) ?

So if M$ has some format conversion functions in their source codes why is there no side link to it ? I cant use MFCreateDxgiSurfaceBuffer in my app because a) minimum supported client for this function is Windows 8 and b) its still failing, even on Windows 8 ! ... 

Is it possible to shift the bytes in the 4 Byte FOURCC from a GUID ?

Any way to encode the format without shifting the bits from each Pixel ?

regards

co0Kie



c# Windows Media Player - Plays one video, won't play the next one

$
0
0

Hi all,

I wrote a simple little program to unveil the draft order for my league's next Fantasy Football draft.  The premise is simple, each time the button at the bottom was clicked, it would play a video picked for the person who got the next pick.  On my system, everything works great.  However, on my wife's and brother's computers, the first button click works perfectly, but each additional click puts a name on the draft board, but the video doesn't play.  There is no error message.  I tried installing as many dependencies as I could find, but nothing works.  Here is the code, any ideas:

private void button1_Click(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.stretchToFit = true;
            if (pickNum >= 0)
            {
                Random rand = new Random(DateTime.Now.Millisecond);

                double pick = 0;
                int x = 0;

                if (pickNum == 9)
                {
                    listBox1.Items[pickNum] = "10. Player 10";
                    File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                    pickNum--;
                    axWindowsMediaPlayer1.URL = "Video10.wmv";
                }
                else if (pickNum == 8)
                {
                    axWindowsMediaPlayer1.URL = "Video9.wmv";
                    listBox1.Items[pickNum] = "9. Player 9";
                    File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                    pickNum--;
                }
                else if (pickNum == 7)
                {
                     axWindowsMediaPlayer1.URL = "Video.wmv";
                    listBox1.Items[pickNum] = "Player Name";
                    File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                    pickNum--;
                }
                else if (pickNum == 6)
                {
                    axWindowsMediaPlayer1.URL = "Video.wmv";
                    listBox1.Items[pickNum] = "Player Name";
                    File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                    pickNum--;
                }
                else
                {
                    end = false;
                    while (!end)
                    {
                        pick = rand.NextDouble() * 100;
                        if (pick < 30 && ten == false)
                        {
                           axWindowsMediaPlayer1.URL = "Video.wmv";
                           listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            ten = true;
                            end = true;
                        }
                        else if (pick < 54 && nine == false)
                        {
                            axWindowsMediaPlayer1.URL = "Video.wmv";
                            listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            nine = true;
                            end = true;
                        }
                        else if (pick < 72 && eight == false)
                        {
                            axWindowsMediaPlayer1.URL = "Video.wmv";
                            listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            eight = true;
                            end = true;
                        }
                        else if (pick < 85 && seven == false)
                        {
                            axWindowsMediaPlayer1.URL = "Video.wmv";
                            listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            seven = true;
                            end = true;
                        }
                        else if (pick < 94 && six == false)
                        {
                           axWindowsMediaPlayer1.URL = "Video.wmv";
                            listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            six = true;
                            end = true;
                        }
                        else if (five == false)
                        {
                           axWindowsMediaPlayer1.URL = "Video.wmv";
                            listBox1.Items[pickNum] = "Player Name";
                            File.AppendAllText("Order.txt", listBox1.Items[pickNum].ToString());
                            five = true;
                            end = true;
                        }

                        if (end)
                        {
                            x++;
                            pickNum--;
                        }
                    }
                }
            }


DXVA-HD EVR Custom Mixer

$
0
0

Hi,

I am trying to implement a custom mixer for the EVR that uses DXVA-HD for mixing streams.

In ProcessMessage I get the MFT_MESSAGE_SET_D3D_MANAGERso I can get a reference to the IDirect3DDeviceManager9, so far so good.

The problem arise when I need to create an IDXVAHD_Device. The create functionDXVAHD_CreateDevice requires an IDirect3DDevice9Exdevice but as far as I knowIDirect3DDeviceManager9::LockDevice can only give me an IDirect3DDevice9.

So how should this creation part be done? Should I request a service viaInitServicePointers() to acquire a ptr toIDirect3DDevice9Ex via my custom presenter. Any ideas?

// Carl



Media Foundation - Working with video files properties

$
0
0

Hello Everyone,

I am working currently on a video player based on media foundation.

I was wondering is there is something similar to IBasicVideo (from DirectShow) available in MF. It would be way easier that to query for all the information that I need.

It is also easy to obtain: IGraphBuilder.QueryInterface(&m_pIBasicVideo);

Some examples would be: get_VIdeoHeight, get_VideoWidth, and others.

Regards,

Alin

About AAC decoder config

$
0
0

Hi all,

I have developed a MKV media source, it's ok to play video, but audio is not, and i have check aduio parameter, it's correct. This is my config and file info:

WAVEFORMATEX afmt;
WAVEFORMATEX* wfe = &afmt;
ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->nChannels = Channels;
wfe->nSamplesPerSec = SamplingFrequency;
wfe->wBitsPerSample = BitDepth;
wfe->wBitsPerSample = wfe->wBitsPerSample==0?16:wfe->wBitsPerSample;
wfe->nBlockAlign = (WORD)((wfe->nChannels * wfe->wBitsPerSample) / 8);
wfe->nAvgBytesPerSec = wfe->nSamplesPerSec * wfe->nBlockAlign;

int size = sizeof(HEAACWAVEINFO) + CodecPrivate.GetCount();
HEAACWAVEINFO* pWaveInfo = (HEAACWAVEINFO*)malloc(size);
memset(pWaveInfo, 0, size);
memcpy(&(pWaveInfo->wfx), wfe, sizeof(WAVEFORMATEX));

pWaveInfo->wAudioProfileLevelIndication = 0xfe;
pWaveInfo->wPayloadType = 0;//raw aac
pWaveInfo->wStructType = 0;

pWaveInfo->wfx.cbSize = size- sizeof(WAVEFORMATEX);

if(CodecPrivate.GetCount() > 0)
	memcpy((BYTE*)(pWaveInfo + 1),CodecPrivate.GetData(), CodecPrivate.GetCount());

HRESULT hr = MFCreateMediaType(&pType);
if (SUCCEEDED(hr))
{
	hr = pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio);
}

hr = MFInitMediaTypeFromWaveFormatEx(pType, (const WAVEFORMATEX*)pWaveInfo, size);
hr = pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_AAC);

free(pWaveInfo);
pWaveInfo = NULL;
General
Unique ID                                : 230449330490480222084075823367818245987 (0xAD5EED37552E8C35B04FFC7FF40AF763)
Complete name                            : E:\clips\Jack_Jac_Attack__720p.mkv
Format                                   : Matroska
Format version                           : Version 1
File size                                : 154 MiB
Duration                                 : 4mn 44s
Overall bit rate                         : 4 542 Kbps
Encoded date                             : UTC 2012-09-05 04:07:16
Writing application                      : mkvmerge v2.4.0 ('Fumbling Towards Ecstasy') built on Oct 11 2008 20:13:15
Writing library                          : libebml v0.7.7 + libmatroska v0.8.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 4mn 44s
Nominal bit rate                         : 4 608 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.209
Writing library                          : x264 core 80 r1378+57 6f6b50a
Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=0 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=4608 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : Main
Codec ID                                 : A_AAC
Duration                                 : 4mn 44s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Default                                  : Yes
Forced                                   : No

thanks

BR

Julis


haha

Media Foundation - Working with video files properties

$
0
0

Hello Everyone,

I am working currently on a video player based on media foundation.

I was wondering is there is something similar to IBasicVideo (from DirectShow) available in MF. It would be way easier that to query for all the information that I need.

It is also easy to obtain: IGraphBuilder.QueryInterface(&m_pIBasicVideo);

Some examples would be: get_VIdeoHeight, get_VideoWidth, and others.

Regards,

Alin

Scrubbing in Media Foundation is not working

$
0
0

I'm using sequencer for seamless playback.
I'm trying to perform scrubbing on my playlist, but it doesn't work as MSDN
describes it.

To simplify my steps:

1) call Pause()
2) call SetRate() to set the rate to 0.0
3) call MFCreateSequencerSegmentOffset() with sequencer element ID and seek position
4) call Start()

First problem is that I never receive the MESessionScrubSampleComplete notification.
(My output node is created with MFCreateVideoRendererActivate)

Second, instead of presenting a still frame, my playback is running at 1-2 fps
after calling IMFMediaSession::Start(). I even checked the rate, it is set to 0.0.

No errors at all.

If it helps, I'm playing 2 wmv files.

Viewing all 1079 articles
Browse latest View live


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