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.
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.
Hope you all be fine and doing great.
I am currently working on a Java Web Application. I am getting Streaming video using RTSP URL. This URL is like:
rtsp://---.---.---./6ca714ae28e52f31
I have been able to capture video, diplay/listen it and store it in .mp4 file using FFMPEG with the following command:
fmpeg -i rtsp://username:password#---.---.---.---/6ca714ae28e52f31 -f mov e:/bay.mov (with authentication)
Now, I want to achieve the same in my Java application using ffmped library. I am sure if all this possible through commands then It will also be possible using its library. But unfortunately couldn't get any working useful material regarding this on web.
So, I simply want to ask that:
1. How can I fetch Streams using this RTSP URL in my Java Application with FFMPEG library
2. How can I Manipulate this fetched streaming such as start, stop, end etc.
3. How can I store this streaming in media file in playable form in any specified format.
I have found a FFMPEG's Java Rapper JJMPEG. Now I have two options either to issue FFMPEG command to CMD using Java Application or use JJMPEG library directly. Don't know which one will be better choice.
Thanks for your time and considerations.
I am trying to create an application where you are able to convert video's to different formats where the video is saved on a web server so that the user can access it once the conversion is complete. What would you recommend as the best way of approaching this?
Example:
-Download a video from a particular website.
-Be able to convert it to MP4 and save the file on a web server.
-Send a notification to the user with the link of the MP4 video.
-Access and download the MP4 video from the link.
So basically the user downloads a video (in ARF format). My program should take that ARF video and convert it to MP4. Once converted, the mp4 saved on a web server and the user informed (i.e. by email) that the conversion has been completed. The user should then be able to view the link and download the MP4 video. I also want to make sure that the program works on Windows, Linux and Mac.
Users can manually specify the file to be converted. I am most confident with Java so is there a way this can be achieved using some of Java's API Libraries & Web Applications?
I was thinking of using JAVE libraries to do the conversion but am not too sure how to then save the video on a web server.
There are several Java libraries for working with various media formats. A prominent one is JFFMPG:
http://jffmpeg.sourceforge.net/
There is also JAVE, which you may find easier to user, depending on your needs:
http://www.sauronsoftware.it/projects/jave/index.php
I am using Java to write a media application.
Given a file, how can I know is it a audio file or video file?
By the way, I use vlcj library.
In Java 7 you will be able to use java.nio.file.probeContentType to do this.
In the meantime, there are a number of other options for doing this kind of thing.
Hey all, i'm new to web development so i'm really dumb when it comes to tools for working on it. I have .amr files recorded from my BB application that are sent and saved on a server. I want to be able to play these files via a webplayer on a website, I have a couple of questions regarding this:
1) Would it be sound to convert these files to something like mp3 o wav instead of trying to play using the amr format? The sound files are received by a java web service and saved as files on my hard drive with the URL saved on a MySQL database. So if a conversion method is suggested I would prefer it be in Java.
2) What player can I use and how, to play these files? Be it the amr files or converted files
3) How can I create a link that will point to said audio file so people can go to it and hear it? I know this differs a little from my original question line but I have to able to do it as well.
thanks in advance
1) MP3 or wav would be a good idea. You could use something like LAMEonJ (http://openinnowhere.sourceforge.net/lameonj/) for wav -> mp3. And with luck there's something similar for AMR.
2) Is the <audio> tag in HTML5 likely to be an option? The users could then play the file directly in the browser, and you could just render HTML on the website, rather than providing it through a webservice.
I think you are suggesting an applet on a web page, that connects to the server via a webservice, which would certainly be possible but a lot more work.
Otherwise, if you're just serving a music file, you're not going to be able to control what player is used on the client side, once they have your file they can do with it whatever they like.
The only down side of HTML5 is that they'll need a relatively recent browser.
3) If you're using <audio> then this is already taken care of.
If you google for the <audio> tag I think you'll find a lot of information,as well as strategies for providing alternative players to older browsers.