Using GStreamer for creating AVI files - java

So, I was recommended GStreamer to create video files. I was going over their tutorial for creating a video file.
The problems I encountered are:
How do I create an AVI file rather than a YUV something.
What is the source being used there?
I want to give a set of BufferedImages or anything else that will show what was going on the screen. I have previously used JPEGtoMovie provided bu the Java guys and for that I had to first save all the images to the disk as JPEG, sort them into their correct order from lexicographical order and a whole lot more.
I was planning to avoid that and that is why I was thinking of Vector<BufferedImage> or BlockingArrayQueue<BufferedImage>
Which all plug-ins do I need from GStreamer to create the AVI output?
Sorry I have been asking too many questions today. I have never worked with a media framework before and I am very dumb

The command gst-inspect will list all included elements (components).
you can produce an avi file from the pipeline: videotestsrc ! encoder ! avimux ! filesink where encoder stands for the encoding element you'd like to use
an alternative would be to use: videotestsrc ! encodebin ! filesink; here you just build a profile and encodebin will figure our what encoder and what muxer to use to create the format specified in the profile
I did not understood the part around the BufferImages. You can feed images manually to gstreamer (e.g. using [appsrc ! decodebin] instead of [videotestsrc]), but thats a last resort. There are also elements such as multifilesrc that read a sequece of images. Maybe you can give more details what you want to do (where do the source frame come from).

Related

extracting text AND Images from PDF file

I have been bumping my head against the wall with this one, have researched and pretty much tried every library suggested to me. I am currently trying to write a program in java that will extract text AND images from a pdf file and allow me to write the extracted content to a word file. I have managed to extract the content using the ICEpdf library, however the problem is that I need to be able to write the content in the exact same order as it was read. So, to clarify, I need a library that will help me keep track of where exactly in the page the text and images are situated so I can put them in the same place in my word file.
A PDF to Word converter is a horribly complex proposition.
Your best bet will probably to use Open Office to do it for you and not even try to handle the intermediate steps.
http://www.openoffice.org/api/
Look at this: Advanced PDF parser for Java
OFF:
-Also to my knowledge there is a python parser that sorta converts the pdf to html (that way you can keep track of the ordering of the objects within the pdf). I know its not java, but you might be able to use the output.
http://www.unixuser.org/~euske/python/pdfminer/index.html

How to read/write custom PNG metadata in Android?

I have to associate a couple of text parameters (a UUID and a couple of strings representing integers) to a PNG image in a way they can follow the image when the PNG file is passed from an Android device to another through the Net. This is the typical situation in which I would use a couple of custom auxiliary chuncks (similar to EXIF fields ) to store my data inside the PNG image itself.
Maybe it is just me but the only info I was able to find about reading and writing PNG custom metadata from Java code on Android was this SO post:
Writing image metadata in Java, preferably PNG
that even offers some code (quite verbose, as usual with Java).
Those same SO post refers also to PNGJ: http://code.google.com/p/pngj/
To be honest, I would be happy to not use yet another library in this project.
Does anybody know of others ways to write and read text metadata in a PNG file in Android? Maybe a less verbose way... Maybe a way that does not require a separated library....
Any other source of information? Any tutorial? Any example?
I'm open to use a different (but equivalent) image file format, if needed (JPEG, whatever).
A solution working also on iOS and Windows 8 Phone would be a plus but it is not actually required.
I had to do something similar lately, so I had to study the subject.
Android offers you no option of manipulating png metadata. You will have to use an external library (PNGJ seems like a good option).
In my case, since I am making changes to the Android frameworks, I didn't use an external lib, but made changes to skia (the Android graphics library instead).
If you need more info on that I can give you, but I think it's irrelevant in your case.

How to convert BufferedImage to AVI?

This question is an extension to my previous question:
Problems associated with my screenshot-taking software
Now with the problems solved, I want to convert the .png images to .avi file. Now the format of images and video doesn't really matter since the images are written to the disk using javax.swing.ImageIO so I can change the save format. So they are BufferedImage before being made as .png
Most questions here on similar topics were asked to use some 3rd party software and all. I want to do it using just Java.
Where do I begin?
Can you help me understand this?
If you don't mind using 3rd party libraries you might want to take look at Xuggler. It's a wrapper for ffmpeg that helped me some time ago.
Update: This demo might contain all you need: https://github.com/xuggle/xuggle-xuggler/blob/master/src/com/xuggle/mediatool/demos/CaptureScreenToFile.java

Is it possible to merge equally sized mp3 format files, and then retrieve, modify each unit file and add new ones in Java?

Is it possible to merge equally sized mp3 format files, and then retrieve, modify each unit file and add new ones in Java? Is there any tool or programming solution?
MP3 format does not allow clean merging of two files to create a new one without re-encoding. The reason is that first and last frame of the file contain some junk information that has to be discarded. You still can merge the files, like here, but it will not be gapless and accurate. Strip id3v1 tag from the first file (last 120 bytes, if it exists), id3v2 from the second file (see this link to see how to find and get size of id3v2), and then merge the files. Things could get complicated if there are LAME frames. But most player should be able to handle these files.
There is nothing built in to Android to achieve that, because there is no MP3 encoder in the SDK. You'll need an MP3 codec library.
See this answer.
Hope the below link helps you to get what you are looking for
Audacity
http://audacity.sourceforge.net/

Java: how to playback uncompressed frames

Given a uncompressed input file with predefined frame format, need to build a simple video player. Could anyone advise where to start? like search keywords, what library to use or examples. Thanks!
For now, I just read all frames and store in linked list which seems not a good idea. Since it should be able to read/playback at same time.
I'm partial to Xuggler. See the MediaTool part of Xuggler that makes it really easy to write programs using media files.
You probably looking for the Java Media Framework
Samples you find here:
and here

Categories

Resources