Resize mp4 video with mp4parser - java

I'm trying to figure out how to resize/scale an mp4 video using mp4parser in an android app. After quite a bit of googling and looking through the mp4parser source and examples, I'm still not sure how to go about doing this.
Does mp4parser have some built in way of doing this?
If not, can I grab the raw video data and resize it myself using mp4parser? (a link to an example would be awesome if possible)
NOTES:
mp4parser website https://code.google.com/p/mp4parser/
I'm willing to consider using a different library than mp4parser, but I'd like something with licensing similar to LGPL. In other words, I am willing to supply library source code and give credit where credit is due, but I'd rather not be forced to make my source code publicly available. (This app will eventually be commercially available).
I need this functionality to append 2 files together that have different resolutions (taken from front camera and back camera).
I have successfully used mp4parser to append 2 files of the same resolutions.
I'm pretty new to video editing.
While I've relied on stackoverflow for many years, this is my very first question asked. Please be gentle. I'll gladly take constructive criticism on the proper way to ask questions here.

mp4parser will not have the ability to do this. To rescale a video, you must decode each frame, rescale then re-encode. ffmpeg (libavformat,libavcodec,swscale) can do this. As for LGPL compatibility, you may be able to achieve it for some codecs, but not all. I assume you are looking for LGPL to include this is a commercial app? If so, you must also license the codecs. For example, x264 is free/open source software. But distributing the videos it creates may require you to pay MPEG-LA.

I am searching it for long time. I couldn't find samples or example.
But i found working app in Google Play.
click to see

Related

Running ffplay video within a jframe

I wish to play a video in JFrame. I am already using ffmpeg in my project. As I wish to keep the project light, I am not willing to use other frameworks like JMF or other. I know that I can play video using ffplay. But the problem here is ffplay opens the video in new window when I try
ffplay output.avi
I wish to put that video within my JFrame, like a player. How can I do this?
Request:
Please ask for any other clarifications, details, and suggest improvements or comment what you find wrong before downvoting or voting to close the question:). I will change it. I am really new to Java, I tried searching this but could not find any possible solution.
What I tried? I couln't find anything related to this, so I don't have any code. I am familiar to how to create frames, and can use runtime to ffplay video. But I got no clue how to put that video within my window:(.
All suggestions are welcome if you can suggest me other methods to play the video. But I haven't use any frameworks other than ffmpeg. And do not wish to make the application heavier. So it would be more helpful if it can be achieved using ffplay.
Look at the JMF 2.1.1 - Supported Formats. If the video types you wish to support are covered by the cross-platform1 version of the JMF, or you can find an SPI for the format, I'd say use JMF.
The 'performance pack' version uses natives which are now very old. I would not recommend trying to use them.

How to make H.264 file fast-forwardable in Android application?

I am an intern at company and my 'learning task' is to make Android application in Java, which takes H.264 format videos (at first they will be stored at SD card) and make like a very simple player, which would have the following features:
1.You can pause/play/fast-forward/fast-backward video
2.When you are at certain point of video and it is stopped, you can switch to the same time in a different video (same picture frame index i guess).
How could i do that? Is using Gstreamer a good way? I looked at the poor tutorial available on net and because of my lack of experience in video processing (I've never worked with video in Android applications) I have quite a hard time understanding what is pipelines, also the JNI and even setting up Gstreamer for Eclipse. Is there a better way of doing this? What should I get to know before starting to mess with this program?
Thanks, in advance!
All of your mentioned features are possible in Gstreamer, however, there is a learning curve.
To understand the GStreamer android tutorials, you must first go through the basic tutorials here: http://docs.gstreamer.com/display/GstSDK/Basic+tutorials
If you feel comfortable with the pipeline architecture, then go ahead and set up your android environment (which is no easy task by itself). Gstreamer is a very very powerful framework where you can do almost anything, if you're willing to make the effort to overcome the learning curve.
So i suggest to go ahead in gstreamer only if you have the time and patience, else go for a simpler solution. Unfortunately i'm not familiar with android, so i cannot suggest any. maybe a quick google search will help.

Breaking a video into predefined chunks

I would like to know how to break a video into frames and store them a collection. I have several cameras that collect at different frame rate and I would like to be able to input the video file as like a .avi or .mp4 and have to work with a collection (probably LinkedList) of frames. Somewhere in the code I would inject the framerate dependency which I can do on my own. I just don't know how to cut up the video. Someone suggested JMF but I am very confused by it. Does anyone know of any examples?
Xuggler is Java library on top of the ffmpeg libraries that makes a task like this relatively easy from Java. Look at the tutorials on the site for a quick start.

Converting audio files(.3gp) to video with Album cover and uploading to YouTube

I have an audio file in .3gp format on my Android device which I wish
to upload to YouTube. I know that YouTube is a video upload site and
that I need to convert this sound file to video.
I just want an image to display all the time the audio is playing.
Google tells me there are number of tools that can help me. But I want
to do this via java code from my Android device.
Please help.
Thanks.
There are tools such as FFMPEG available for free that allow you to, essentially, mix and convert heterogenous streams. That is you can add a bitmap to a video, create video from slide shows and then add sound etc. (See a related question I asked here).
These programs can be executed from within java applications by making Runtime.exec(..) calls.
Sun has an example for stitching multiple JPEGs together into a movie, you can find it here. You should be able to take this example, (its fairly robust), and add what you need to it.
I recommend looking into the Java Media Framework (FAQ)
You can find a vast collection of sample applets/code at the Sun Solutions page. You can find the API on this page. I do hope this is compatible on the Android platform, as I haven't had any personal experience developing for it. But it might be a good place to start.

Sequenced video playback (cutlists) in Java.. can it be done?

If I have a bunch of video files, all in precisely the same format, shape, whatever, then can I play them back seamlessly without jumps or gaps? The effect from the end user's point of view would be as though they are watching one video.
I understand that this is possible in DirectX, but I'd rather use Java if possible.
If you want to play media in Java, the Sun standard is JMF (http://java.sun.com/javase/technologies/desktop/media/jmf/) which unfortunately has been dormant for quite a while.
The FMJ project (http://fmj-sf.net/) is API-compatible and under active development.
I cannot answer your question better, but hopefully this can get you further.

Categories