Re: Capture the Image from a video file
Thanks a lot. But when I view the program in the thread, it seems that it needs to some program code is to play the video first and then the image can be captured. Is it possible that even I don't write the code for playing the video first and just write the captured code so that can still capture the image by using Java only from the exists video file. Thanks a lot.
Thanks a lot. But when I view the program in the thread, it seems that it needs to some program code is to play the video first and then the image can be captured. Is it possible that even I don't write the code for playing the video first and just write the captured code so that can still capture the image by using Java only from the exists video file. Thanks a lot.You can get away without playing the video by seeking to the frame you want using FramePositioningControl ( [example here|http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/Seek.html] )and then capturing the frame using FrameGrabbingControl (similar to the code I posted). But still you would have to load the video file, create the player using url, realize the player, perhaps prefetch it (all in the link I have given above) then you are ready to seek to particular frame and capture it. But now you don't need to actually start the player so that video/audio is visible/audible.
Thanks!
Similar Messages
-
Dears ,,
how to change the path that sysprep were copied to reference computer when i capture the image from reference.
Should i modify some codes in LTIAPPLY.wsf? how to modify it?
Thanks.Sysprep and capture has *Three* steps.
1. Run sysprep on the local machine (easy).
2. Copy WinPE down to the local machine so we can reboot into winpe for capture.
3. Capture the drive in an *offline* state from within WinPE.
What is most likely happening is that you are having problems with step #2. 100MB is *WAY* too small to copy down WinPE. By default MDT will make this System partition much bigger, 499MB. IF you install Windows 7 from the default media. IT will only create
a 100MB partition.
By default MDT 2012 Update 1 and greater *should* recover to a fallback drive with the OS on it, however if you are running older versions that might not happen correctly.
If you are still having problems, copy your BDD.log file to a public share like OneDrive and copy the link here.
Keith Garner - keithga.wordpress.com -
Raspberry Pi B+ capture a image from a video cam
Hello,
is there any way to capture a image from the video camera. I didn't find any media class for video. Nor did I find any Runtime.exec to use a native linux command.
Did I overseen something?Hi Klaus,
There a few ideas in design stage, but nothing solid enough to talk about. And actually it should not have been possible with older ME as it's specifically prohibited by the spec. I mean native methods in Java applications. Of course there may be other means to communicate with native applications, like files, sockets etc. But no direct calls
The date for ME 8.1 GA (General Availability) release is not confirmed yet. But it should happen quite soon, stay tuned
Regards.
Andrey -
Can I rip the audio from a video file?
I have a video file with a band singing on it. I have an ipod nano, so I can't import the video with the singing onto my ipod. Is there anyway to rip the audio from the video file and put that onto my ipod?
-ThanksOpen the video in Quicktime Player.
Select the Export menu item.
Change the Export type to "Sound to Wave".
Save the WAV file somewhere with the default settings.
Load the WAV file into iTunes and use iTunes to convert it to AAC for the Nano. -
Re: how to capture a frame from a video file and save it as a jpeg
package com.snn.multimedia;
* @(#)FrameAccess.java 1.5 01/03/13
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
import java.util.Date;
import java.util.Arrays;
import java.util.Iterator;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageOutputStream;
import javax.imageio.ImageWriter;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
import javax.media.*;
import javax.media.control.FramePositioningControl;
import javax.media.control.TrackControl;
import javax.media.Format;
import javax.media.format.*;
import javax.media.util.BufferToImage;
import javax.media.util.ImageToBuffer;
import java.io.FileOutputStream;
import java.io.OutputStream;
import com.sun.image.codec.jpeg.*;
* Sample program to access individual video frames by using a
* "pass-thru" codec. The codec is inserted into the data flow
* path. As data pass through this codec, a callback is invoked
* for each frame of video data.
public class FrameAccess extends java.awt.Frame implements ControllerListener
Processor p;
Object waitSync = new Object();
boolean stateTransitionOK = true;
* Given a media locator, create a processor and use that processor
* as a player to playback the media.
* During the processor's Configured state, two "pass-thru" codecs,
* PreAccessCodec and PostAccessCodec, are set on the video track.
* These codecs are used to get access to individual video frames
* of the media.
* Much of the code is just standard code to present media in JMF.
public boolean open(MediaLocator ml)
try
p = Manager.createProcessor(ml);
catch (Exception e)
System.err.println("Failed to create a processor from the given url: "
+ e);
return false;
p.addControllerListener(this);
// Put the Processor into configured state.
p.configure();
if (!waitForState(p.Configured))
System.err.println("Failed to configure the processor.");
return false;
// So I can use it as a player.
p.setContentDescriptor(null);
// Obtain the track controls.
TrackControl tc[] = p.getTrackControls();
if (tc == null)
System.err.println("Failed to obtain track controls from the processor.");
return false;
// Search for the track control for the video track.
TrackControl videoTrack = null;
for (int i = 0; i < tc.length; i++)
if (tc.getFormat() instanceof VideoFormat)
videoTrack = tc[i];
break;
if (videoTrack == null)
System.err.println("The input media does not contain a video track.");
return false;
VideoFormat currentFormat = (VideoFormat)videoTrack.getFormat();
System.err.println("Video format: " + videoTrack.getFormat() );
videoTrack.setFormat(new VideoFormat("RGB", currentFormat.getSize(), currentFormat.getMaxDataLength(), currentFormat.getDataType(), currentFormat.getFrameRate()));
// Instantiate and set the frame access codec to the data flow path.
try
// Try to retrieve a FramePositioningControl from the player.
FramePositioningControl fpc = (FramePositioningControl) p.getControl("javax.media.control.FramePositioningControl");
if (fpc == null)
System.err.println("The player does not support FramePositioningControl.");
System.err.println("There's no reason to go on for the purpose of this demo.");
return false;
Time duration = p.getStopTime();
long totalFrames = 0;
if (duration != Duration.DURATION_UNKNOWN)
System.err.println("Movie duration: " + duration.getSeconds());
totalFrames = fpc.mapTimeToFrame(duration);
if (totalFrames != FramePositioningControl.FRAME_UNKNOWN)
System.err.println("Total # of video frames in the movies: "
+ totalFrames);
} else
System.err.println("The FramePositiongControl does not support mapTimeToFrame.");
} else
System.err.println("Movie duration: unknown");
long[] frames;
if (totalFrames > 0L)
double intervalDouble = Math.floor(totalFrames / 5.0);
long interval = new Double(intervalDouble).longValue();
frames = new long[5];
frames[0] = 1;
frames[1] = frames[0] + interval;
frames[2] = frames[1] + interval;
frames[3] = frames[2] + interval;
frames[4] = frames[3] + interval;
} else
frames = new long[1];
frames[0] = 1;
// Codec codec[] = { new PreAccessCodec(), new PostAccessCodec()};
Codec codec[] = { new OverlayCodec(frames)};
videoTrack.setCodecChain(codec);
catch (UnsupportedPlugInException e)
System.err.println("The process does not support effects.");
// Realize the processor.
p.prefetch();
if (!waitForState(p.Prefetched))
System.err.println("Failed to realize the processor.");
return false;
// Display the visual & control component if there's one.
setLayout(new BorderLayout());
Component cc;
Component vc;
if ((vc = p.getVisualComponent()) != null)
add("Center", vc);
if ((cc = p.getControlPanelComponent()) != null)
add("South", cc);
// Start the processor.
p.start();
setVisible(true);
return true;
public void addNotify()
super.addNotify();
pack();
* Block until the processor has transitioned to the given state.
* Return false if the transition failed.
boolean waitForState(int state)
synchronized (waitSync)
try
while (p.getState() != state && stateTransitionOK)
waitSync.wait();
catch (Exception e)
return stateTransitionOK;
* Controller Listener.
public void controllerUpdate(ControllerEvent evt)
if (evt instanceof ConfigureCompleteEvent
|| evt instanceof RealizeCompleteEvent
|| evt instanceof PrefetchCompleteEvent)
synchronized (waitSync)
stateTransitionOK = true;
waitSync.notifyAll();
} else
if (evt instanceof ResourceUnavailableEvent)
synchronized (waitSync)
stateTransitionOK = false;
waitSync.notifyAll();
} else
if (evt instanceof EndOfMediaEvent)
p.close();
System.exit(0);
* Main program
public static void main(String[] args)
if (args.length == 0)
prUsage();
System.exit(0);
String url = args[0];
if (url.indexOf(":") < 0)
prUsage();
System.exit(0);
MediaLocator ml;
if ((ml = new MediaLocator(url)) == null)
System.err.println("Cannot build media locator from: " + url);
System.exit(0);
FrameAccess fa = new FrameAccess();
if (!fa.open(ml))
System.exit(0);
static void prUsage()
System.err.println("Usage: java FrameAccess <url>");
* Inner class.
* A pass-through codec to access to individual frames.
public class PreAccessCodec implements Codec
* Callback to access individual video frames.
void accessFrame(Buffer frame)
// For demo, we'll just print out the frame #, time &
// data length.
long t = (long) (frame.getTimeStamp() / 10000000f);
System.err.println("Pre: frame #: " + frame.getSequenceNumber()
+ ", time: " + ((float) t) / 100f + ", len: "
+ frame.getLength());
* The code for a pass through codec.
// We'll advertize as supporting all video formats.
protected Format supportedIns[] = new Format[] {
new VideoFormat(null)
// We'll advertize as supporting all video formats.
protected Format supportedOuts[] = new Format[] {
new VideoFormat(null)
Format input = null, output = null;
public String getName()
return "Pre-Access Codec";
// No op.
public void open()
// No op.
public void close()
// No op.
public void reset()
public Format[] getSupportedInputFormats()
return supportedIns;
public Format[] getSupportedOutputFormats(Format in)
if (in == null)
return supportedOuts;
} else
// If an input format is given, we use that input format
// as the output since we are not modifying the bit stream
// at all.
Format outs[] = new Format[1];
outs[0] = in;
return outs;
public Format setInputFormat(Format format)
input = format;
return input;
public Format setOutputFormat(Format format)
output = format;
return output;
public int process(Buffer in, Buffer out)
// This is the "Callback" to access individual frames.
accessFrame(in);
// Swap the data between the input & output.
Object data = in.getData();
in.setData(out.getData());
out.setData(data);
// Copy the input attributes to the output
out.setFormat(in.getFormat());
out.setLength(in.getLength());
out.setOffset(in.getOffset());
return BUFFER_PROCESSED_OK;
public Object[] getControls()
return new Object[0];
public Object getControl(String type)
return null;
public class OverlayCodec extends PreAccessCodec
long[] myFrames;
BufferedImage work;
byte[] workData;
int width;
int height;
int dataLen;
RGBFormat supportedRGB = new RGBFormat(null, // size
Format.NOT_SPECIFIED, // maxDataLength
Format.byteArray, // dataType
Format.NOT_SPECIFIED, // frameRate
24, // bitsPerPixel
3, 2, 1, // red/green/blue masks
3, // pixelStride
Format.NOT_SPECIFIED, // lineStride
Format.FALSE, // flipped
Format.NOT_SPECIFIED); // endian
public OverlayCodec(long[] frames)
// force specific input format
supportedIns = new Format[] {
supportedRGB};
myFrames = new long[frames.length];
System.arraycopy(frames, 0, myFrames, 0, frames.length);
public String getName()
return "Capture Codec";
public Format setInputFormat(Format format)
if ((format != null) && (format instanceof RGBFormat)
&& format.matches(supportedRGB))
// set up working image if valid type
// (it should be since we insisted!)
Dimension size = ((RGBFormat) format).getSize();
width = size.width;
height = size.height;
dataLen = width * height * 3;
if ((dataLen > 0)
&& ((work == null) || (work.getWidth() != width)
|| (work.getHeight() != height)))
// working image - same 3-byte format as buffer
work = new BufferedImage(width, height,
BufferedImage.TYPE_3BYTE_BGR);
// reference to pixel data
workData = ((DataBufferByte) work.getRaster().getDataBuffer()).getData();
return format;
* Callback to access individual video frames.
void accessFrame(Buffer in)
try
if (Arrays.binarySearch(myFrames, in.getSequenceNumber()) >= 0)
BufferToImage stopBuffer = new BufferToImage((VideoFormat) in.getFormat());
Image stopImage = stopBuffer.createImage(in);
BufferedImage outImage = new BufferedImage(140, 96,
BufferedImage.TYPE_INT_RGB);
Graphics og = outImage.getGraphics();
og.drawImage(stopImage, 0, 0, 140, 96, null);
FileOutputStream fout = new FileOutputStream("image"
+ in.getSequenceNumber() + ".jpg");
writeImage(outImage, fout);
catch (Exception e)
e.printStackTrace();
public int process(Buffer in, Buffer out)
try
accessFrame(in);
BufferToImage stopBuffer = new BufferToImage((VideoFormat) in.getFormat());
Image stopImage = stopBuffer.createImage(in);
ImageToBuffer outImagebuffer = new ImageToBuffer();
out = outImagebuffer.createBuffer(stopImage, p.getRate());
// Swap the data between the input & output.
in.copy(out, true);
catch (Exception e)
e.printStackTrace();
return BUFFER_PROCESSED_OK;
void writeImage(BufferedImage outImage, OutputStream os) throws Exception
Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
ImageWriter writer = (ImageWriter) writers.next();
ImageOutputStream ios = ImageIO.createImageOutputStream(os);
writer.setOutput(ios);
writer.write(outImage);
ios.close();Hi,
I have a jpeg movie file 60 mins long and a text file tell me five time-lines for breaking the movie. For example, break the movie at 10:21, 16:05�
The final output should be five small jpeg movie files. Each file contains a 90 sec (30 sec before the break time and 60 sec after the break time).
Do you know any java library (jar) contain the library that can help me on programming this? Any existing source code? Any SDK for a movie editor can do that?
Please help.
Thanks
Kenny -
How do you extract the audio from MP4 video files in iMovie 8?
Trying to pull the audio out of an MP4 file. Any and all help is appreciated. Thanks in advance.
Share your project using SHARE/EXPORT USING QUICKTIME.
Choose SOUND TO AIFF. -
Displaying the image from camera after processing
Hi,
Using NI vision assistant I captured the image from the camera in continous mode with inline processing. Then the image was proceesed (filter,threshold and particle analysis), then I created a bounding box and integrated that with the real time video. But, the image viewer is displaying the image in binary form rather than in RGB space.
I can't find any mistake.
Please help.
Thank you.Hi illuminator,
Can you post your VI and provide some more information?
Thanks as kudos only -
Downloading audio from a video file from iTunes?
I have a 40G 4th Gen click wheel iPod (no color or video). Is there a way to download just the audio from a video file that I have in iTunes?
I use Steve's method all of the time, and edit the Audio output in Adobe Audition. You will want to Export/Share to PCM/WAV @ 48KHz 16-bit, and keep that format both going and coming back into PrE. Remember that you will be working with an Audio file, that is the full (or almost) Duration of the Timeline. When you Import that edited Audio file, give the program a few moments to Conform that newly Imported PCM/WAV for editing. I suggest not touching the computer, until Conforming has completed 100%, and the little progress bar in the lower-right of the GUI has disappeared. If the Imported Audio file is short, and your computer is fast, you might not even see that progress bar, but the Conforming has taken place, just the same.
I like to keep the original Audio on its Audio Track(s), and just use Window>Audio Mixer to Mute that/those Track(s), leaving only my edited Audio on its own Track un-Muted. This is a "fail-safe," just in case I change my mind along the way, and wish to revert to the original Audio for some reason. It is much easier to Mute-Unmute, than to gather up all of that original Audio again.
Good luck, and happy editing,
Hunt -
How do I take the audio from a video and divide it into separate songs
How do I take the audio from a video file and divide it into separate audio songs? I then want to export those songs into itunes.
http://www.bulletsandbones.com/GB/GBFAQ.html#exportsections
(Let the page FULLY load. The link to your answer is at the top of your screen) -
Capture Pictures/Images from Video
Hello All,
I am just getting warmed up in these forums here. I wanted to know if you could capture still images from video clips and if they are Kodak clear. I have a couple of family videos that I would like to have pictures taken from and framed. Does anybody know much about this?<[email protected]> wrote in message <br />news:[email protected]..<br />> Thats interesting. I had talked to a representative from Adobe and I was <br />> told it would be crystal clear of a photograph! That includes after the <br />> image being deinterlaced...<br /><br />It will be "clear." However, the clarity of a picture is a function of the <br />original video and the resolution. Standard definition digital video is 720 <br />x 480 pixels for a total of 345,600 or, roughly, 1/3 of a megabyte. This is <br />very low resolution compared to what a good digital still camera can <br />produce, i.e. 4-8 megabytes. A high-definition frame will contain 1,920 x <br />1,080 pixels, totaling 2,073,600. A 2 megabyte frame will produce a <br />reasonable 4 x 6 photograph.
-
In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone which are downloaded and not saved,but they remain in cache.
Even in some apps i have data which i want to remove,but cant find a way to remove them and they are in my cache eating up my memory.Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.
-
How do I make a still image (photo) fit the length of the music? I record music and want to convert the tracks to a video file with a still image of my business logo in the background. On windows movie maker you could just select "fit to music" but this program isnt as easy to figure out! Any help?
Double-click on the still image in the project timeline to open the Inspector. In the Inspector, adjust the duration by typing in a new duration to match the length of your music. I think the limit for a still image is 10 minutes. If you need more than this, simply drag the image into the timeline again then adjust its duration. The two images will play seamlessly (no gap will be visible).
See this iMovie Help topic:
http://help.apple.com/imovie/#mov3a883915
You can achieve more precision when entering durations by changing a preference in the menu item iMovie Preferences. Check (tick) the preference for Show Time As HH:MM:SS:frames. This will enable you to enter the duration of stills down to the frame level, rather than full seconds (NTSC is 30 frames per second; PAL is 25 fps). When entering times, type a colon between each time segment, such as 2:50:15, which represents 2 minutes 50 seconds and 15 frames. For 5 seconds 20 frames you would enter 5:20 and so forth.
Note that the music will only run to the length of the video in the timeline (in your case, the still images). So, after increasing the stills duration you will need to drag the end of the music track as far as required. The stills can be dragged inwards to reduce the duration if necessary.
John
Message was edited by: John Cogdell - added Note -
I have my camera (Canon 5D Mark 2) set to take both JPEG Large and Raw files with each shot. I uploaded the images from the card to my Pro (Aperture 3) and while the import info said 1500 images were uploaded, I can't find the RAW images. Aperture put about 700 images in an untitled project folder, but all the images are the JPEGs. What am I missing?
Thanks,
upsjdrisHave you checked your "Import" settings for "Raw&Jpeg" pairs in the "Import" panel?
You can set Aperture to import raw, jpeg, or raw&jpeg.
If you imported Raw&Jpeg, but have set Aperture to use the Jpeg as original, you will see the imported image as Jpeg image, not as a raw image, even if the raw has also been imported. You can switch between Raw and Jpeg originals for selected images from the Photos menu:
Photos > Use Raw as original.
Regards
Léonie -
Recently Image Capture stopped working. It can't find one camera and can't find the images from a different camera. Help?
Launch iPhoto. From the menu: iPhoto>Preferences>General: Select Connecting camera opens>Image Capture.
-
Which programs if any can extract the image from existing QTVR pano file?
Which programs if any can extract the image from existing QTVR panorama files that were created with one image?
Any ideas?
Thank youUnless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
Justin
Maybe you are looking for
-
How do I free up space on my C drive by moving photos to a separate hard drive on the same pc?
I need to free up space on my C Drive by moving photos to Seagate expansion (H) drive. Currently use Windows Vista and elements 11 where I have organiser containing folders and albums which I want to keep intact after the move. Photos are currently h
-
When I try to connect my iPhone to my computer, it seems to be working fine (iTunes opens and connects), but still I'm getting this problem when my computer tries to install the supervisory program/driver (I'm not sure how to say it in English since
-
Idoc failed in Bi system "Could not find code page for receiving system".
Dear Experts, i am getting below error ,Idoc failed in Bi system "Could not find code page for receiving system". All the idocs have been successfully posted except one which is giving this error Idoc status 02 - could not find code page for receiver
-
Installing SAPgui 720 using Microsoft SCCM (sms)
Microsoft System Center Config Manager. On workstations that we installed the SAPgui update using MS SCCM 2007 we are not able to uninstall sapgui. SAP has recommended that we use SAPgui installation server to install the updates (instead of a tool s
-
Multiple Black and white conversion from raw or jpgs
Hi All Any help would be appreciated. I have 300 wedding images taken on raw and jpg. I now want to convert them all to black and white. Any way I can do this without doing it one at a time (whether using raw or jpg files)? Hope someone has the answe