1

I know that this question has been asked before, but no one gave a clear answer. Almost Every answer I saw on this topic included the use of what is called ffmpeg.

Now I am not an expert in media codec and stuff like that but I understand that ffmpeg takes some good time before it compress the video. Not to mention how complicated the license is for this library.

My question:

What is the popular way of doing this, how do we compress a video fast before upload?

I want to give an example of whatsapp, how do they compress the video quickly before upload? Can we do something similar?

EDIT

As @CommonsWare suggested yes I mean by compress to reduce the resolution of the video.

Thanks.

  • Video files (e.g., MP4) are already compressed. Please explain in detail what you mean by "compress a video". Do you mean "reduce the resolution of the video"? Do you mean "reduce the frame rate of the video"? Do you mean something else? – CommonsWare May 16 '18 at 14:06
  • @CommonsWare yes reducing the resoultion. –  May 16 '18 at 14:08
  • @CommonsWare any advice? –  May 16 '18 at 14:16
  • 1
    If you are the one recording the video, record it at your desired resolution (within the limits of what that device's camera supports). If you are not recording the video, I am not aware of anything that will change a video's resolution quickly. This is slow on desktop hardware, let alone on mobile devices. – CommonsWare May 16 '18 at 14:29
  • @CommonsWare yes I am the one recording the video, but my real problem comes when I want to give the media codec the needed width and height, I noticed that all examples on this give 1280 and 720.....If I try to give something lower like 480 by 270 then my output video becomes weirdly cropped eventhough it reduces the size. Any idea why? –  May 16 '18 at 14:36
  • You need to see if the camera supports that resolution, using methods like `hasProfile()` on `CamcorderProfile`. – CommonsWare May 16 '18 at 14:46
  • @CommonsWare is it possible that a device doesn't support a certain resolution for recording? –  May 16 '18 at 14:59
  • Absolutely. *Always* check to see what resolutions the device supports. – CommonsWare May 16 '18 at 15:21
  • @CommonsWare I will keep that in mind thanks for your help, you are very informative as usual. –  May 16 '18 at 15:25

0 Answers0