What are my options if I want to compress a video before upload in Java?
I am uploading a video file which is in .mov or .mp4. I want to compress it (little loss of quality is acceptable) before uploading to Amazon S3. Is there a library in java which can accomplish that ? I found one called Xuggler but it looks a lot complex. Is there 开发者_StackOverflow中文版any other way ?
The best diy option is to use ffmpeg.
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video
It's is a command line tool so can be called by a java app. Here's a tutorial on how to encode to H.264
Another option is to outsource your encoding to an encoding service like encoding.com or Ankoder. Both those integrate with S3 and can upload the encoded videos to your S3 account.
精彩评论