2 Replies Latest reply: Apr 28, 2011 4:19 PM by 856191 RSS

    Creating DataSink after programming processor for another use

    856191
      This is a new thread to discuss off-topic question from Re: JMF - Concurrent video feed and image capture

      To summarize, I am trying to create a system that accesses frames coming off a processor, and detects motion from these frames. When motion is detected, it needs to record video. I have the two systems running independently. I can detect motion correctly and without issue, and I can also save a file using a live feed. But I am having problems putting them together when creating a DataSink to save the video. Right now, I receive this output whenever motion is detected and it tries to record:

      Something is really wrong: the processor does not have an output DataSource
      Failed to create a DataSink for the given output MediaLocator: file:mov.avi

      Relevant post from above thread:
      captfoss wrote:

      Something is really wrong: the processor does not have an output DataSource
      Failed to create a DataSink for the given output MediaLocator: file:mov.avi

      Those two things seem to suggest the processor couldn't be realized, which generally means you've tried to transcode from one format to another format that isn't supported...
      http://www.oracle.com/technetwork/java/javase/formats-138492.html

      Additionally, the problem could be that "file:mov.avi" needs to be a URL, and you've given it a bad URL... that's perfectly valid input to the original program, but take a look at the createMediaLocator method...

      Specifically,
      String file = "file:" + System.getProperty("user.dir") + File.separator + url;
      Note that it's giving it a full URL path to the file... so you need to do the same.
      The code is posted in the linked thread, so I won't post it again here and waste more space.

      I'm pretty sure the problem lies either (as mentioned above) in that (1) I'm trying to transcode from one format to another; or (2) my process of creating and programming the processor to access frames coming off the camera, then trying to create a DataSink for video recording functionality is incorrect.

      I have been working under the (tested) assumption that If I provide a string that is "file:mov.avi", the createMediaLocator() method will attempt to create a MediaLocator in the current directory. This is what I've been using to test video recording in a stand-alone manner, and it works just fine. Regardless, to test this more fully, I gave it a full path to the current directory being used, and I received the same error.

      The first question I have, so that I can be sure my logic is correct, is what is the high-level method or process that I would need to go through in order to program the processor to access the frames, and then use it to create a DataSink that will be used later to record when motion is detected?

      Edited by: 853188 on Apr 28, 2011 9:20 AM
        • 1. Re: Creating DataSink after programming processor for another use
          captfoss
          The first question I have, so that I can be sure my logic is correct, is what is the high-level method or process that I would need to go through in order to program the processor to access the frames, and then use it to create a DataSink that will be used later to record when motion is detected?
          You can only setup stuff before it's going. You can't create a DataSink for a Processor that's already processing... and depending upon how you're handling getting the frames from the processor, you may very well be disabling its ability to have an output... I've advised you not to do things the way you said you were doing them, but, I don't have any idea how your current set of code works.

          There are a number of ways you could get such a system to work with custom components, but, they would all kind of depend on what you're doing.

          Can you outline specifically what your current setup is, and exactly how it works?
          • 2. Re: Creating DataSink after programming processor for another use
            856191
            captfoss wrote:
            You can only setup stuff before it's going. You can't create a DataSink for a Processor that's already processing... and depending upon how you're handling getting the frames from the processor, you may very well be disabling its ability to have an output... I've advised you not to do things the way you said you were doing them, but, I don't have any idea how your current set of code works.

            There are a number of ways you could get such a system to work with custom components, but, they would all kind of depend on what you're doing.

            Can you outline specifically what your current setup is, and exactly how it works?
            I'm going to email you all of my code to give you an idea of what I'm doing.