Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    12

    How do you perform a rolling recording of video?

    I want to figure out a way to perform a rolling recording of video for n seconds. Here's an example to illustrate what I'm trying to achieve:
    • Let's say I want to record video for a rolling 60 seconds
    • I start the video recording at 12:00:00
    • At 12:01:00, I now have a full 60 seconds of recorded video
    • Now at 12:01:01, I want to still have only 60 seconds of recorded video in memory, but it needs to be the latest 60 seconds. This means the first second recorded earlier now has to be disposed to free up memory.



    RESEARCH:
    I've gone through this article and created a very basic video recorder. Unfortunately, there's just not much to work with here if you want to do anything other than saving the whole recording session. This article is compatible with WP7, so it doesn't cover any of the advanced classes now available in WP8. It's very unfortunate since this seems to be the only video recording example that Microsoft has decided to publish, and it is highly likely that the advanced new classes are required to achieve a rolling recording.
    http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx

    This guy has the same question, but crickets for answers ever since it was asked months ago:
    http://stackoverflow.com/questions/1...d-certain-time

    This guy seems to be on the right track with the AudioVideoCaptureDevice class, but there's not much to go on here by way of an example:
    http://stackoverflow.com/questions/1...ocapturedevice

    The MSDN documentation for the AudioVideoCaptureDevice class is pretty worthless without examples to accompany such a complex topic:
    http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx

    This guy worked out his issues using the AudioVideoCaptureDevice class to record audio, but nothing about video and no mention of partial recordings
    http://social.msdn.microsoft.com/For...orum=wpdevelop


    FINAL THOUGHTS:
    Please don't mention trying to port some crazy huge library like FFMPEG , and please don't reply just to tell me it can't be done or you don't know how. There are already plenty of those types of responses all over the internet. I refuse to believe that this cannot be achieved, and I will continue to search for the solution to the ends of the earth/internet!

    If you have some working code or even ideas on where to go from here, bring on the replies. Let's work through this together and help all the other developers out there struggling with this challenge.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    529

    Re: How do you perform a rolling recording of video?

    Currently the Windows Phone APIs don't provide you with anything aside from capturing encoded Audio/Video-Data into a stream. You can hook it up to a control for display but that is basically the extent of APIs provided by the OS. There are no new/advanced Video APIs in WP8 compared to WP7.5.

    Of course you could consume the data written to the stream, analyze it and start discarding old frames when you reach a certain length. The issue is that you either have to look into how the multiplexing of audio and video data works on Windows Phone (I assume it's the one defined for the .mp4 file format), demultiplex the stream, remove the unncessesary frames, cut the unnecessary audio samples and remultiplex the result). Given that we don't have any existing libraries on WP that allow you to do this it is quite a complicated task to do, that requires a lot of knowledge about how this works. That is the reason why people suggest you to look into porting an existing library that already can do all of this (like FFMPEG).

    At this point in time my suggestion would be to just wait until Microsoft releases information on Windows Phone 8.1 which is due to be released in H1 2014. Windows 8 and Windows RT which share quite a lot of code with WP8 already provide the Microsoft Media Foundation which aids you in Audio/Video manipulation (for an example of this see here: http://msdn.microsoft.com/en-us/libr.../hh700365.aspx). This currently isn't available on WP8 but I'd guess that if support for Video manipulation arrives it will be using those APIs.

    You're currently assuming that simply nobody knows how to do what you want to achieve while there simply isn't a system level support for it and so we know that you only have the options to either build support yourself or wait for it to be provided in a future update or by some library developer.

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    12

    Re: How do you perform a rolling recording of video?

    Thank you for your response SB Dev. Let's figure this out guys! Who knows how to mess with demultiplexing video streams on WP8?

    This is the most promising nugget of code I've seen yet, and it's right here on this site.
    http://developer.nokia.com/Community...ideo_Recording


    I'm going to continue collecting links to wayward souls looking for this elusive solution.

    Here's yet another guy trying to tackle this issue.
    http://stackoverflow.com/questions/1...ecording-video

    And another...
    http://stackoverflow.com/questions/1...indows-phone-8
    Last edited by Rob.Kachmar; 2013-11-27 at 23:41.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    529

    Re: How do you perform a rolling recording of video?

    You can find a description on how a h264 video stream is composed in this paper: http://keyj.emphy.de/files/projects/SA_paper.pdf

    I belive the description on how to detect an ISlice can be used to find the "cutting points". Didn't try how a file cut down in that way would play later on.

  5. #5
    Registered User
    Join Date
    Dec 2013
    Posts
    1

    Re: How do you perform a rolling recording of video?

    I'm guessing this is for the DVLUP challenge?

    Why don't you just create small standard video files of say 60 seconds and then stitch them if needed at the end.
    The challenge does mention FFMEG but you would think the import thing is the actual outcome, not how it's achieved.


    Quote Originally Posted by Rob.Kachmar View Post
    I want to figure out a way to perform a rolling recording of video for n seconds. Here's an example to illustrate what I'm trying to achieve:
    • Let's say I want to record video for a rolling 60 seconds
    • I start the video recording at 12:00:00
    • At 12:01:00, I now have a full 60 seconds of recorded video
    • Now at 12:01:01, I want to still have only 60 seconds of recorded video in memory, but it needs to be the latest 60 seconds. This means the first second recorded earlier now has to be disposed to free up memory.



    RESEARCH:
    I've gone through this article and created a very basic video recorder. Unfortunately, there's just not much to work with here if you want to do anything other than saving the whole recording session. This article is compatible with WP7, so it doesn't cover any of the advanced classes now available in WP8. It's very unfortunate since this seems to be the only video recording example that Microsoft has decided to publish, and it is highly likely that the advanced new classes are required to achieve a rolling recording.
    http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx

    This guy has the same question, but crickets for answers ever since it was asked months ago:
    http://stackoverflow.com/questions/1...d-certain-time

    This guy seems to be on the right track with the AudioVideoCaptureDevice class, but there's not much to go on here by way of an example:
    http://stackoverflow.com/questions/1...ocapturedevice

    The MSDN documentation for the AudioVideoCaptureDevice class is pretty worthless without examples to accompany such a complex topic:
    http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx

    This guy worked out his issues using the AudioVideoCaptureDevice class to record audio, but nothing about video and no mention of partial recordings
    http://social.msdn.microsoft.com/For...orum=wpdevelop


    FINAL THOUGHTS:
    Please don't mention trying to port some crazy huge library like FFMPEG , and please don't reply just to tell me it can't be done or you don't know how. There are already plenty of those types of responses all over the internet. I refuse to believe that this cannot be achieved, and I will continue to search for the solution to the ends of the earth/internet!

    If you have some working code or even ideas on where to go from here, bring on the replies. Let's work through this together and help all the other developers out there struggling with this challenge.

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    529

    Re: How do you perform a rolling recording of video?

    The problem is that you'd have to remove the headers from the separate files when stitching them together (so you'll have to be able to at least analyze those from the stream). Also it's an interesting question if you'll be able to stop recording and start recording again to a different sink without dropping frames (which might be crucial). Even if you used ffmpeg I'd guess you'd approach the whole thing similarily to what you said - e.g. recording to several sinks and discarding files no longer needed.

Similar Threads

  1. How to Pause the Video recording and resume recording After pausing
    By hari21.mca@gmail.com in forum Mobile Java General
    Replies: 1
    Last Post: 2012-04-02, 19:27
  2. Video Recording in j2me and Get videosnapFrame from video..
    By hari21.mca@gmail.com in forum Mobile Java General
    Replies: 2
    Last Post: 2012-03-23, 19:48
  3. Automatically perform video call through java programming
    By EzonJimenez in forum Mobile Java General
    Replies: 6
    Last Post: 2008-09-19, 14:44
  4. Replies: 0
    Last Post: 2008-02-25, 08:55
  5. How to perform video streaming by J2ME?
    By chris3388 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-01, 18:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×