locked
Merge/Combine/Remux/Mix Video and Audio file together

    Question

  • Hi all,

    I have and problem about Windows Runtime to play FLV file,

    So I doing some work to splite FLV file into 2 diffrent file

    one is video file, format is AVI

    another is audio file, format is MP3

    I search internet found few solution,

    "DirectShow" seem like a solution, and I got some .NET C# Code work perfectlly,

    Can combine Video and Audio file into Single video file.

    So I start port those code into Windows Runtime, but some COM Compoment are not allow using in Windows Runtime..

    So I want to ask is anyone doing this job before?

    Thanks!

    Thursday, November 06, 2014 2:57 PM

Answers

  • Hello,

    You can write a MediaStreamSource using C#. However as mentioned above I don't belive this alone will give you the functality that you are looking for. A custom MediaStreamSource will allow you to plug into the MediaElement for playback but your scenario is much more complex. You will likely need to write some C++ / Cx code. Most of the Media Foundation APIs should be called directly from MoCOM. Unfortunatley there is no easy way to do this from C#. You may be able to find a 3rd party wrapper but that is not somthing that I can recommend.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, November 10, 2014 9:16 PM
    Moderator

All replies

  • Hello,

    First we do not support FLV natively on Windows Phone 8.1. You will need to write a custom Media Source or find a 3rd party one that can parse the file format (I don't believe you can use a MediaStreamSource with the Source Reader). Once you have your custom Media Source that can parse the FLV file format. You will need to register it so that it can join the Media Foundation topology using the MediaExtensionManager.

    Assuming that the FLV file contains MP4 and ACC data (it may not) and you are targeting a Windows Phone 8.1 Runtime app you can use the Source Reader to open the FLV file and get the compressed audio and video streams. Once you have the compressed samples you can create two Sink Writers to save the streams to a file independently of each other.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, November 07, 2014 2:08 AM
    Moderator
  • Thanks your replied,

    I know Windows RT don't support FLV naively.

    And I got lot of data, and ask Developer who developed "PressPlay Video" app.

    He give me some hint to implement FLV support, which I need demux FLV into general format(like AVI, MP4)

    and Remux again.

    And he tell me he didn't write and C++ code, only C# can archive this function.


    I also search Sink Writers, but It seen like need write some C++ code.

    That's maybe wrong way...

    Is there have any Media Foundation in C#? .NET C# is OK, I can port .NET into Windows RT.

    I have been search internet few days.


    • Edited by THKAW Sunday, November 09, 2014 10:04 AM
    Sunday, November 09, 2014 10:02 AM
  • Hello,

    You can write a MediaStreamSource using C#. However as mentioned above I don't belive this alone will give you the functality that you are looking for. A custom MediaStreamSource will allow you to plug into the MediaElement for playback but your scenario is much more complex. You will likely need to write some C++ / Cx code. Most of the Media Foundation APIs should be called directly from MoCOM. Unfortunatley there is no easy way to do this from C#. You may be able to find a 3rd party wrapper but that is not somthing that I can recommend.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, November 10, 2014 9:16 PM
    Moderator