2

I am using the Kaltura client library for Android to upload a video.

It successfully creates the entry on the server, but when it gets to the point of actually uploading the video file, it fails with Error 413 - Request Entity Too Large.

KalturaMediaEntry mediaEntry = new KalturaMediaEntry();
mediaEntry.name = title;
mediaEntry.mediaType = KalturaMediaType.VIDEO;

mediaEntry = kalturaClient.getMediaService().add(mediaEntry);

KalturaUploadToken token = new KalturaUploadToken();
token = kalturaClient.getUploadTokenService().add(token);

ContentResolver resolver = getContentResolver();
InputStream inStream = resolver.openInputStream(selectedVideoUri);

Cursor cursor = getContentResolver().query(selectedVideoUri, null, null, null, null);
int sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE);
cursor.moveToFirst();
long size = cursor.getLong(sizeIndex);
cursor.close();


// this fails
kalturaClient.getUploadTokenService().upload(token.id, inStream, title, size);

I've tried using an extremely short video (2 seconds) and even that failed. Not sure where to look from here.

Cr6
  • 21
  • 2

1 Answers1

0

It looks like the request has some incorrect parameters.

These are the parameters it's looking for:

  • uploadTokenId (string)
  • outFile
  • resume (boolean)
  • finalChunk (boolean)
  • resumeAt (number)

Source

If the file is too large you may have to chunk it and upload the chunks. Kaltura has documentation and an example in their developer resources.

Sreenshot of Request Parameters

2xj
  • 720
  • 6
  • 7