unsupported video format: 3gp
jpage4500 opened this issue · 2 comments
We're uploading video and running a transformation on it. I haven't noticed any issues until a crash just recently on a Samsung Galaxy S6 (below)
Caused by java.lang.RuntimeException: unsupported video format: 3gp
at com.cloudinary.android.UploaderStrategy.callApi(UploaderStrategy.java:130)
at com.cloudinary.Uploader.callApi(Uploader.java:34)
at com.cloudinary.Uploader.upload(Uploader.java:76)
at com.cloudinary.Uploader.upload(Uploader.java:68)
at com.bleachr.fan_engine.utilities.CloudinaryMediaService.upload(CloudinaryMediaService.java:120)
// allows optimized video streaming
// - http://cloudinary.com/documentation/upload_videos#incoming_transformations
options.put(KEY_TRANSFORMATION, new Transformation().width(DESIRED_VIDEO_SIZE).height(DESIRED_VIDEO_SIZE).crop("crop").gravity("center").videoCodec("auto"));
...
Map options = new HashMap();
options.put(KEY_RESOURCE_TYPE, resType);
options.put(KEY_PUBLIC_ID, publicId);
Map results = cloudinary.uploader().upload(new File(filePath), options);
I'm using MediaRecorder
to create the video. It's my understanding that some devices will only record in .3gp format but isn't this just a video container similar to .mp4?
I do have some logic that uses the file extension .3gp if that's what the device supports
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
...
if (profile != null && profile.fileFormat == MediaRecorder.OutputFormat.THREE_GPP) {
suffix = ".3gp";
} else {
suffix = ".mp4";
}
Any suggestions? I am going to try just saving the file as .mp4 to see if that's all the uploader code is complaining about
Hi,
You can't request transformation for unsupported video format (3gp).
So just upload the 3gp file (with no transformations), and after the uploading process completed, you must change the format to one of the supported formats in order manipulate the video.
Another option is to include the format change while uploading, so the video file should save as mp4 t Cloudinary.
i.e -
the original 3gp link - res.cloudinary.com/cloud_name/video/upload/video_name.3gp
working manipulations - res.cloudinary.com/cloud_name/video/upload/w_500/video_name.mp4
Closing this issue due to the time elapsed. Please feel free to either re-open the issue, contact our support http://support.cloudinary.com or create a new ticket if you have any additional issues.
Add Comment