Upload video to google drive

Hello, I was working on uploading a video to google drive with the camcorder. as you can see below


it is working with camera, so I tried to clone it with the camcorder component

but i got the error saying "Attempt to invoke virtual method "boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int,java.io.OutputStream)' on a null object reference". This is my code
.
I saw that @TIMAI2 is into this, hope you can help me modify this code

Thanks in advance

i found the camera version in this topic:

Did you look at the path for the clip ? It is probably a contentUri which cannot be read by the base64 extension.

Use Taifun's File extension to convert the content uri to a file path, then try....

image

or

If you use @Juan_Antonio 's Base64 extension, you can convert a file to base64 string, and find a block to convert a contentUri to a file path.

1 Like

can you guide me through the first option Tim.

Using KIO4_Base64 extension, should look like this:

(checked that the file path does not change after API 29/30....)

1 Like

ill try it and get back

Sorry, not working, more testing needed

1 Like

yeah, it isnt working

what about the taifun file extension version?

OK, this working in companion on Android 13

(you may want to do some cleaning up of files at some point in /DCIM/Camera)

1 Like

what is ASD?

anyways ill do and check it

it works in the companion but doesnt work in the app, im on android 11

what do i do

Will have to debug a compiled app to see what is going on

1 Like


thats what i have to indicate an error but we could list the errors out maybe we could find it.

Any solution to it?

My tests show that the base64 string is not being generated (the clip is being successfully copied to the ASD), even if I include a clock timer, and the app eventually crashed. Will need to revisit this later and try a different method.

These are my testing blocks (I am not trying to upload yet....)

1 Like

what will happen if we use the taifunfile extension

There is no issue with the contenturi conversion, and I have never had a problem converting to base64 string with Juan's extension. Just need to work through the flow.

1 Like