locked
Capturing Video and Audio in the Background

    Question

  • Hi,

    We're developing a "Skype" like application, streaming live Video and Audio
    over the net.

    Currently we're using MediaCapture to capture Video using Media Foundation, and TCP
    sockets to stream it using proprietary protocol.

    Our question is: How can we keep capturing Video on the background when the user
    switches away from the application?

    Now since Microsoft's Skype can do that for both Video and Audio, it won’t be reasonable
    to get "There's no option..." as an answer, because it will be
    kind of "Unreasonable" or “Unfair” since Microsoft can't stop other from
    writing competitive apps, like Google Chrome did, for an instance.

    Any pointers to "secret" APIs, also any help in this field will be highly appreciated.

    Regards,

    Tomer


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.






    Friday, January 04, 2013 4:39 PM

Answers

  • Hi Tomer,

    I just confirmed that the Simple Communication sample keeps the video chat live even when one switches away from it and uses other apps. If that isn't what you are looking for or if it isn't the behavior that you see then please provide clearer details about exactly what you are doing (repro steps, code, etc.), the behavior you want, and how the actual behavior differs from that.

    --Rob

    Sunday, January 06, 2013 8:09 AM
    Owner

All replies

  • Hi Tomer Shamam,

    I think by using the background task you can do that Please check the Background Tasks which might help you. In my work I used back ground task for downloading a file. Which is working perfectly even after switching the app. But I am not having any idea about the feasibility of reading the camera content in background and streaming. This is just an idea, sorry if I am wrong.

    Regards,

    Raja KPV

     


    raja

    Saturday, January 05, 2013 6:32 PM
  • Hi Raja, thanks for trying but using Background Task won't help. Trust me, I've already tried the simple ones. Now I'm looking the "secret gems", or the "hacking" stuff, which of course won't pass Microsoft's certification, but this is a different story.

    I really expect someone from Microsoft to answer this question, explaining why Skype can do that, and competitive app is restricted from doing so!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Saturday, January 05, 2013 8:53 PM
  • Nobody from Microsoft can help you with undocumented internals.

    Why do you think you need a secret way to do this?

    --Rob

    Sunday, January 06, 2013 2:51 AM
    Owner
  • Hi Rob,

    The secret way is the first Microsoft's demo code I've used the first day I searched the web for how to stream video and audio, and I also based my code on it.

    Again, my problem is not how to stream video and audio, rather how to stream video and audio while application is suspended.

    This is why I know that I need an undocumented internals.

    /TS


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, January 06, 2013 7:25 AM
  • Hi,

    I'm posting this question again, now with my MSDN subscription account to get answered in two days, as stated in MSDN Subscription "Priority Support in MSDN Forums".

    I'm developing win8 store app to one of my customers, which develops Skype like application.

    Starting with this Microsoft's demo:

    http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290

    How can we keep capturing Video and Audio in the Background while Application is Suspended, like Skype does?

    Best Regards,

    Tomer Shamam


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, January 06, 2013 7:54 AM
  • Hi Tomer,

    I just confirmed that the Simple Communication sample keeps the video chat live even when one switches away from it and uses other apps. If that isn't what you are looking for or if it isn't the behavior that you see then please provide clearer details about exactly what you are doing (repro steps, code, etc.), the behavior you want, and how the actual behavior differs from that.

    --Rob

    Sunday, January 06, 2013 8:09 AM
    Owner
  • Hi Tomer,

    Please don't post duplicate posts. I've merged your two into a single one. Also note that priority support applies to the specifically listed forums. Even though the Windows Store apps forums are not on that list, we do strive to ensure that you have a response within the two business day timeframe here as well (and occasionally even at midnight on weekends ;) )

    --Rob

    Sunday, January 06, 2013 8:15 AM
    Owner
  • Thanks Rob for being a great help! I though posts placed before attaching an account to MSDN won't get priority.

    Also, don't work too hard, it can wait for Mon... ;)


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Sunday, January 06, 2013 8:18 AM
  • Hi Rob,

    I've checked it again, and, what do know... It's working :)

    The only thing I've never did is running it with two computers connected or connecting to localhost using second option. With first option, one computer, it stops when application got suspended.

    The only thing keep bothering me, is that the App keeps running, and never suspended. Which is GOOD!

    But searching the Win8 Store Apps SDK, there's no document describing such an option, even in Background Tasks, unless I've missed something. It looks like this breaks the new app-model, moving running apps to suspended mode if user switches away.

    Is there any place I can read more about this low-latency feature? It looks like there is no Background Task, and the app keeps streaming...

    How is that?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Sunday, January 06, 2013 8:35 AM
  • After discussing the matter with microsoft, i want to clarify the subject for the others.

    The reason that the app keeps broadcasting the video is because the app doesnt get Suspended, and the reason it doesnt get suspended is because the MediaElement that displays the video has the "AudioCategory" attribute with the value "Communications"

    This value indicated that the source is coming from peer-to-peer communication and thus the OS doesnt suspend the app.

    The second requirement is that the app will have a BackgroundTask decleration in the appxmanifest with "Audio"  option checkd.

    The app is kept alive ONLY because it has registered for background audio and is playing an active communications stream



    Tuesday, January 29, 2013 8:17 AM
  • it works !!!!
    Thursday, July 11, 2013 9:55 PM