Posting large video file on Facebook from android - android

Hi am trying to post video file on Facebook from my android application, I am able to post 5MB file successfully but when I am trying to post large file say 95MB java.lang.OutOfMemoryError brokes out. I followed this link to post the video.
Is there any other methods to post the video file on Facebook. Please help me to resolved this issue.
Thank you.

Your video filesize is probably larger than the amount of free memory allocated on your device. Considering that you said you were trying to upload a 95MB file on your smartphone, that is too large to hold in a byte[].
I found solutions online that allows you to upload chunks of data at a time to prevent OOM exceptions, but AFAIK our Facebook Android SDK doesn't have that sort of option available. Your best bet is to either compress/scale the video to a more acceptable size, or write your own method to POST a video to Facebook in chunks.

Related

How to compress video file before uploading to the server in Android?

I'm trying to upload video file (Captured/Selected from gallery) to the Server but currently it takes lot of time so, I want to compress the video file before uploading it to the server. I searched a lot but yet didn't find any acceptable solution. Please help. Thank you..
Try using "FFMPEG" library. You can find details at https://github.com/bramp/ffmpeg-cli-wrapper.
I found it not difficult to start with.

How to upload short videos (10-15 secs) from an Android App to AWS using Node.js?

Once the application gives me a GET Request for the file along with the video,
what should we use in our Node.JS file to correctly optimize the video, compress/encode the video in which format and minimize the uploading time for end user?
I understand the file needs to be asynchronously uploaded. But what should be my backend systems be designed like?
We'll be using AWS, and Mongo DB. So all the videos will be uploaded to S3 Bucket. Is this the best practice?
Basic requirement is I am trying to make the uploading video as much scalable and concurrent for multiple users to upload video.
Are there any kind of best practices or tutorial for the kind of video formatting and uploading in Node.JS we are looking for?

how to upload a large size zip file to server in android using the progressing/streaming method?

In my application I want to zip more images and the zipped file should get uploaded to the server using the HTTP connection. Now I have completed the zipping process. But due to the large file size I could not uploaded directly like an image upload.
Any one could you please share your ideas for the same? Is there any possibilities to achieve this? And please refer me if you knows any third party app for the same.
Thanks.

Android Compress Video before Upload to Server

How can I compress a video file in Android before uploading to a remote server? I'm not looking to zip up the file, because I don't think that will help much. I want to compress the video and re-encode it with a lower bit-rate or resolution. The idea is to get a standard 360х480, 30 FPS video file from every device. This way I can avoid users with better cameras being forced to upload huge video files.
I know iOS makes it fairly simple to force video file resolutions. 10 second video recorded on iPhone 4:
high (1280х720) = ~14MB = ~11Mbit/s
640 (640х480) = ~4MB = ~3.2Mbit/s
medium (360х480) = ~1MB = ~820Kbit/s
low (144х192) = ~208KB = ~170Kbit/s
Is there any easy way to do this in Android? Do I need to find some external library that will let me re-encode the video file, then save it to the SD card (or overwrite the old video file), then upload that file? Mainly looking for general direction here and not code to copy and paste, although anything is helpful.
I got a similar problem. Where I had to upload video in server having size within 5.4mb. But due to different camera resolutions of different phones, there was a problem. These are the solutions which I have opted
mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mediaRecorder.setVideoEncodingBitRate(690000 );
Hope these will help you
One of the app that I worked on earlier has this requirement of sending the video file after compressing it. Here are the steps I followed which worked:
Compress the file using a Silicompressor library in android. Run the compression task on a background thread.
The output file format will have the mime type "video/raw". You can check that in logcat. So, you need to add this mime type in your server so that the compressed file format is uploaded successfully.
After this is done, trying sending the compressed file and it should work.
Make sure the mime type of the file you are uploading to server is accepted by the server.
Read About this Library, its the best for new mobile which has a Full HD cameras
Compress Video with high quality for Java and Kotlin
We decided to save this functionality for another iteration of the project. We opted to warn the users of the large data payload (especially if they are not on Wi-Fi). I'm confident this can be done, and the link provided by tabbykitten is the best related SO post I've found on this topic to this date.
From API level 18 onwards you have direct android API to do Video Encoding but if you are targeting Less than API level 18 it not straight forward
the below link does the encoding
https://github.com/google/grafika/blob/master/src/com/android/grafika/VideoEncoderCore.java

Upload 3gpp file to a web server

My question is I have used many examples of http uploads of files for the android. They all seem to work except for video files that are .3gpp. I use the same code for .mov video files and it works OK. On the web side is just a PHP script. Does any know or have successfully uploaded a video (.3gpp) to a server? I don't get any error that I can see. The code I use also works for image files (jpg). It's just the .3gpp file type.
Thanks for any help you can give me..
isnt it 3gp
is it possible u are giving it the wrong extension?
i would say that the method u are using to upload should be pretty dumb to what files its uploading so it should work (as u said). the only other thing is i would try to match file size. so do a 5mb picture then a 5min video to ensure it is the file type causing the error
i would also say that maybe the 3 in the extension could cause problems (depending on how or what is reading it)

Categories

Resources