I created about 10 different projects in adobe premiere to create video sequences of 4 images with an audio in the background and the text on the images. The duration of the clip is 30 seconds. The problem is that I have to create more than 1,000 videos of different image sequences. I thought about creating a script in C or Java or any other programming language to automate this: in practice the script should copy the images to a folder start the rendering and when finished go to the next slide. I found nothing. Someone knows how to help?
You might want to consider using an entirely commandline-based process instead of trying to use Adobe Premiere. This would allow it to be easily scripted.
FFMpeg is a commandline tool allows you to create a video from a sequence of images -- one image for for each frame of the video. You can also mix-in your audio file with FFMpeg. The hardest step will be generating images that have the proper text superimposed.
For more info on using FFMpeg you can start with an example like this:
https://lukecyca.com/2013/stop-motion-with-ffmpeg.html
Related
I have two files - audio(mp3 or wav) and video(mp4 or avi) with the same duration. I want to merge them and send to the front.
Which java library will help me to implement that?
If you mean you want to merge the audio and the video on the server side, so that the merged video can then be streamed to the client, then using ffmpeg via a wrapper may be the easiest approach.
The ffmpeg command line is well used and it is quite easy to ask and receive answers to any particular syntax. Using a Java wrapper approach allows you leverage this syntax and give you the flexablity to use other ffmpeg functionality in the future if you need it.
A popular up to date Java Wrapper is available here:
https://github.com/bramp/ffmpeg-cli-wrapper
If you actually want to stream the audio and the video to the browser separately and do the merging there, then, if you are not worried about an exact match (e.g. needing to synch audio to speech to keep it in lip synch), you can actually just start the audio player and video player simultaneously and the browser will play both together. This worked on all major browsers I tested it on for a project several years ago and I am not aware of anything changing to stop this working.
In some situations (automated testing) I need to screencast my display(s) to video file(s), but currently i can only save a series of PNG files using Robot and ImageIO classes, I know there are other third party programs to convert this set of image files into a video file but I want to make it in my code without a need to third party applications, so how to convert from a series of PNG files into a video file in any format ? Thanks in advance.
I would just get FFmpeg and use that to convert your images to video. You can make syscalls in Java if what you mean by "third party application" is "I don't want to do it manually" as FFmpeg supports command-line.
For example, maybe something like
String[] cmds = {"path/to/ffmpeg", args ... }
Runtime.getRuntime().exec(cmds);
There are many tutorials available on how to use ffmpeg to convert a sequence of images to a video file.
I'm building an app in Grails, but I am well versed in Java also. I need to display thumbnails of video files, and then when the user clicks on a thumbnail, open that video in a player. (Like Youtube).
What I am thinking is, when the user posts the video, I'll use xuggler to grab a thumbnail, and save that along with the video file itself.
Question 1: Is that a good design?
I am not familiar with xuggler.
Question 2: Is there some way to grab a thumbnail from input stream as the user is uploading? Otherwise, I am going to write the file, and then grab the thumbnail from that as described here.
Xuggler seems like the way to go.
I'm doing something similar at the moment. I'm opting to download the entire file payload before attempting to assume I was given a video.
I've built a similar system in PHP and users submitting Windows Movie Maker project files was a real issue.
application/octet-stream was a very common content-type from machines that didn't know file type associations
We have a java web application where users can upload all kinds of files including any kind of video files. Now we want to allow them to stream these video files they own. So I need to make sure that they are the owner and then stream video. Also possibly stream a preview.
Do I need to convert these video files before streaming and where should I look to get started?
The best video playback/encoding library I have ever seen is ffmpeg. It plays everything you throw at it. (It is used by MPlayer.) It is written in C but I found some Java wrappers.
FFMPEG-Java: A Java wrapper around ffmpeg using JNA.
jffmpeg: This one integrates to JMF.
I am looking for a 100% Java solution for encoding software generated images into an AVI stream together with an uncompressed audio track.
At the moment I am using JMF, but its size and installation problems make it a bad solution for my purpose.
While it does not support audio, I created an MJPEG AVI Java class some years ago. You basically just tell it the resolution of your output video, along with the frame rate, then you just keep adding images to it. When you are done, you tell it to finish and it'll close out the AVI. It is based off of the Microsoft documentation on AVI, RIFF, and BITMAP file formats.
Other than not supporting audio, the only real problem is it implements the version of the AVI format limited to 2GB per file. While the class will write out a much larger file, I am uncertain that any players or video editors would be able to read it.
The way I've used this code in the past, is to generate an MJPEG AVI for processing in a video editor (adding audio, etc. in the editor). It helped me with automating some tedious slide show generation. Not sure if this code will help you, as is, but it might help if you are trying to roll your own solution. MJPEGGenerator.java is available if you are interested!
You can use JMF, see this nice example.
There is a nice blog entry here:
http://www.randelshofer.ch/blog/2008/08/writing-avi-videos-in-pure-java/
By Werner Randelshofer