I capture a video but can't save it .How to halndle the problem via JMF?
Hi everyone, I'm starting to use JMF and faced the problem
The problem is to save captured video in .avi or .mov formats.I managed to capture and play it in a player, but can't save it .On the other hand when I used processor to capture and save the video , I've succeeded .But my task is to combine these two actions. Give a hint please.
All kind of replies will be greatly appreciated.
Edited by: postvard on Feb 25, 2009 12:03 AM
>
You need to get the StreamWriterControl on the DataSink, rather than the Processor.I doesn't seem to work.
import java.awt.BorderLayout;
import java.awt.Component;
import java.io.IOException;
import javax.media.CannotRealizeException;
import javax.media.Control;
import javax.media.DataSink;
import javax.media.Format;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.NoDataSinkException;
import javax.media.NoProcessorException;
import javax.media.Processor;
import javax.media.ProcessorModel;
import javax.media.format.VideoFormat;
import javax.media.protocol.DataSource;
import javax.media.protocol.FileTypeDescriptor;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.media.control.MonitorControl;
import javax.media.control.StreamWriterControl;
public class MyProcessor extends JPanel {
private MediaLocator locator=null;
private Processor processor=null;
private DataSource dataSource=null;
private DataSink filewriter=null;
private Format[]formats=new Format[1];
public MyProcessor() throws NoProcessorException, CannotRealizeException, IOException, InterruptedException {
setLayout(new BorderLayout());
FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO);
Format[]format=new Format[1];
format[0]=new VideoFormat(VideoFormat.YUV);
locator=new MediaLocator("vfw://0");
processor=Manager.createRealizedProcessor(new ProcessorModel(locator,format, new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO)));
Control controls[] = processor.getControls();
for(Control c:controls){
if(c instanceof MonitorControl){
MonitorControl mc = (MonitorControl) c;
mc.setEnabled(true);
if (mc.getControlComponent() != null) {
add("Center", mc.getControlComponent());
dataSource= processor.getDataOutput();
MediaLocator dest = new MediaLocator("file:record1.avi");
try {
filewriter = Manager.createDataSink(dataSource, dest);
Control[] dataSink_controls= (Control[])filewriter.getControls();
for(Control c1:dataSink_controls){
if(c1 instanceof StreamWriterControl){
StreamWriterControl stream_size=(StreamWriterControl)c1;
if(stream_size!=null){
stream_size.setStreamSizeLimit(30000);
filewriter.open();
} catch (NoDataSinkException e) {
System.exit(-1);
} catch (IOException e) {
System.exit(-1);
} catch (SecurityException e) {
System.exit(-1);
try {
filewriter.start();
} catch (IOException e) {
System.exit(-1);
processor.start();
//Thread.currentThread().sleep(20000);
// processor.stop();
// processor.close();
// filewriter.stop();
// filewriter.close();
public static void main(String[] args) {
try {
MyProcessor processor1=new MyProcessor();
JFrame frame=new JFrame();
frame.setSize(300,300);
frame.add(processor1);
frame.setVisible(true);
} catch (NoProcessorException e) {
e.printStackTrace();
} catch (CannotRealizeException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
Similar Messages
-
I have an Apple I Phone 4S which is great but, can someone help me how to get the photos and videos to my PC which runs on MS XP. I would like to be able to edit and copy photos and videos to a DVD.
Connect your iPhone to your computer. Tp your pc should recognize your iPhone as a camera. Use what ever application you have on the pc to transfer files from a camera to your computer.
-
I got an ipod touch from my friend, but can't figure out how to change the apple id to get games. Help?
Never mind, I got this.
-
I installed OSX server 10.6 snow leopard on my IMAC, but still have choppy videos. can anyone tell me how to fix the problem
By your use of "still", did this problem exist before OS X Server was installed? OS X Server itself has no particular linkages to video processing, beyond what OS X client provides.
Some details on the configuration might be useful. Are these videos you're having issues with stored locally in files, or are these videos received over the network and played? If the videos are local, have you tried playing the videos from a different disk? If the video files are remote, can you download the videos and play them as a test?
What software are you using to play the videos? QuickTime? QuickTime X? Does using VLC or another player work better? There are some discussions of choppy videos around the forums, too. -
I have an iPod mini library which I have update. I now have an iPhone 4S which I have synced to the library using a MS XP computer. I can not figure out how to get the library to download to my iPhone?
Thanks, This caused me to go back and try again since the solution seemed so simple. What I did was when it started downloading, it started with the iphones apps to my computer. I did not want the apps downloaded on my computer so I stopped it. If I would have waited, the music was uploaded right after the apps were downloaded.
-
Need to download app store but can't find
App Store is in your Applications folder and there should also be an icon in the Dock.
-
How to access the list and genre of the free ebooks, also the paid ones. I have a few, but I know there are thousands of others to choose from, but don't know how to access them. Thanks!
I'm another one of the very grumpy customers regarding the problems synching Outlook calendars with the new 2.0 iPhone.
I have another twist: I did not ever have multiple calendars in Outlook until the 2.0 update; I had just one. After I updated the iPhone software to 2.0 I have multiple calendars which I did not create. My iPhone has all the events listed, color coded by these various calendars, but when I look at my calendar(s) in Outlook, I can not see all the events at once. So my iPhone is the most complete, and my computer version is fragmented. This is an unacceptable royal pain. I'm relieved to know it's not just me, my iPhone, my Outlook, etc., but I'm definitely one of the many of us who are grumpy with Apple and impatient for their fix.
My question is: how do I sync my Outlook to my iPhone and delete all these calendars without deleting events? I just want one calendar again: mine, all mine.
PS I do have recurring events, but way too many to hand change them all; that's ridiculous. Even if I didn't have many of those it's ridiculous that the recurrences should create these problems. It's a pretty basic electronic calendar function. -
How do I copy JPEGs that I see in "Preview" without getting aliases? I want to burn a new disk with copied originals, not aliases?
You can create a new folder and drag the originals into it and burn that as well, the "burn folder" concept just makes it easier to not to have to put everything away later.
Just delete the burn folder and your done. -
Can anyone tell me how to fix the problem with downloading music? Now with the new iOS5
Ever since the new iOS5, and now 5.1, whenever I download music, and play it on my iPad2, the album cover will "flash" white between each song, whereas before the picture would hold steady for the duration of the album play! I have to admit I find this REALLY annoying! Even syncing with my MacBook doesn't fix the problem...any ideas?
Hi Jane,
First, regarding the virus issue, although I cannot promote any specific 3rd party software, there are plenty of FREE and very good anti-virus apps out there. You can Google 'free antivirus" and a good list will come up. You may want to look at a few reviews before you try. I don't know if you use Mac or Windows so you may have to do a little research on which is best for your computer platform. You can run the software and it will help clean off your system if there's a virus.
Second, regarding your Elements sync to Revel, you may need to disable and then re-enable the Revel sync agent from within Elements, which you find in Preferences. In addition you may try signing out and then back into Revel via Elements.
Let me know how that goes. If the disable/re-enable doesn't help, I'll get an Elements team member to see if they can help.
Best of luck on the virus software!
Glenyse -
All that's showing is my Inbox and a Deleted box under it. I don't have a Sent, Drafts or Archive icons showing and when I send emails they go but they don't save to either Sent or Drafts.
How do I get these boxes please?
KimNote; if you did not get a copy of the emails off the old server into your Local Folders and you move away from the old server to a new server, you will not have any access to those emails on the old server.
-
Hi, I've registered for the free trial of Adobe Cloud in order to try out Indesign CC - but I can't get further than the "register new products" in my profile. I'm a complete beginner - please help! Thanks.
Hi solawista,
Please find the download instructions in the link below.
Creative Cloud Help | Install, update, or uninstall apps
If you face any sort of error refer the link below.
Troubleshoot Creative Cloud download and install issues
Thanks,
Atul Saini -
The video was shot on a sony cybershot DSC-H70
Hi, jjsylves.
Thank you for visiting Apple Support Communities.
If the media is still located on your computer, I would create a version specifically for the iPad. To create and iPad version in iTunes 11 select the media that you are wanting to convert. From there, select the File menu > Create New Version > Create iPad or Apple TV version. Once the media has been converted, sync the iPad version to the iPad.
iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
http://support.apple.com/kb/TS1497
iTunes 11 for Windows: Syncing overview
http://support.apple.com/kb/PH12311
Regards,
Jason H. -
How do I reinstall Quick Time Pro for the second time if I no longer have the original email even though I have the registration code??
My PC died and I want to reinstall on a new PC.Download and install the "free" version of QuickTime Player from Apple.
Under its Edit menu choose Preferences / Registration and enter your info. This "unlocks" the Pro features found in the free download. -
I am currently using iPhone 3GS and when I am going to download foursquare which is a FREE application in the App Store, it came up with a message saying Verification Required which means I need to pay for it. Can anyone tell me how to solve the problem? For further informations, I am currently using Windows running Vista. Special thanks to those who replied.
Your iTunes account sounds like it does not have a credit card or payment attached to it. Even free apps require that you have entered payment information even though you won't be charged for the app.
-
i have downloaded the app game your video but i cant save the videos to my photo library and i cant enable permission because it doesn't appear in privacy settings
If you have not provided access, you can do so by going to default Settings app > Privacy > Photos and switch ON Game Your Video.
Game Your Video saves all videos to its own library. To sync to Camera Roll, simply go to Library and tap on Multiple selection button. Now select the videos to copy and tap on Sync button in the bottom bar. (See screenshot attached)
But you still have some issues, just email it to their support team: [email protected]
Also update the app. Game Your Video 2.0 is available on the App Store.
Maybe you are looking for
-
My 13" late 2011 MacBook Pro will not turn on..
My MacBook Pro only displays one blinking dot on the battery indicator and the MagSafe charger does not display and lights once plugged in and the computer does to respond when pushing the power button Please help
-
Powershell import-spweb fails with "parent does not exist" error.
So, I have a sp 2010 site at http://myfarm/sites/it/d22 and I want to copy the contents to http://myfarm/sites/bb/d62 . I perform Export-SPWeb -Identity http://myfarm/sites/it/d22 -Path d:\temp\d22 -IncludeUserSecurity –IncludeVersions All -NoFil
-
Eastern european edge web font lora
Hi, I've designed a website using edge web font "Lora" in czech language. It looks good on my Mac, but when viewing on iPhone, iPad or PC (all browsers), there are not international characters like č, ř, š, ě... I know, that this typeface contains al
-
Final Cut Studio on MacBook Pro
Will all Final Cut Studio 2 programs and features run efficiently on a new MacBook Pro 13"? If not, what MacBook Pro would be the cheapest to run it on?
-
Printing from Elements 8 using Epson Stylus Photo R300
Help! I'm really quite useless at all this computer stuff, and my problem is slowly driving me mad!!! I am trying, unsuccessfully, to print from Elements 8 using an Espon Stylus Photo R300. However, I dont know what settings to use. I can get pri