How do i encode media file on base64 - base64

Iam building a multimedia website and I don't want to upload the media files directly to my website.I want to encode it on base64 and then copy and paste it to my website

Related

Generate thumbnail for multiple file formats

For the purpose of creating thumbnails for files like pdf, jpg, and docx, I'm looking for a library or service. My server stores data on GCS, and the front-end application should only display brief file previews.
If the thumbnail doesn't already exist, I'd like to create it, save it to gcs, and serve it with a signed url.
I found a few solutions:
filepreview-es6 library - updated 5 years ago
filepreviews.io - external service - the data are confidential
gotenberg.dev - returns only pdfs
How to implement this feature in 2022?

S3 image link getting downloaded for some image links and viewed for some image links

I'm trying to select files from my system and uploading it in the AWS S3 Bucket. When trying to do so, the URL that is generated gets downloaded when clicked but when I upload it from the camera and not selecting it from the system, I'm getting the URL which can be viewed from the browser.
I got to know that the links are stored in virtual host style when uploaded from the camera and stored in path style when selected from the file system. How can I make the S3 URL's downloadable either way ?

How can I compress or convert wav file before or after upload to server

I'm using Nodejs and React.
I need to record user voice message and save it to server for later.
Currently I'm getting file size of 400kb for 5 sec of audio.
I'm getting blob and convert it to base64 and upload it to server where it's saved to file as that.
How can I reduce file size, compress it or something and later just link it to without any need to uncompress on backend

My base64 audio file is not the same as the one google cloud speech send

I want to translate an audio file to text via google google cloud speech api.
I record an audio file of type :
audio/x-flac type with codecs=opus.
My audio file transcribed to base64 gives this (I only put the beginning):
GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwH/////////FUmpZpkq17GDD0JATYCGQ2hyb21lV0GGQ2hyb21lFlSua7+uvdeBAXPFh6ZbkBme7LiDgQKGhkFfT1BVU2Oik09wdXNIZWFkAQEAAIC7AAAAAADhjbWERzuAAJ+BAWJkgSAfQ7Z1Af/////////ngQCjjIEAAID7A//+//7//qOMgQA7gPsD//7//v/+o4yBAHeA+wP//v/+//6jjIEAs4D7A//+//7//qOMgQDvgPsD//7//v/+o4yBASuA+wP//v/+//6jQOmBAWiA+4MCAv/+//5+Gjf43iuAMUp0LKWeBuKWw5OP5gEM9j8POpNh6x2zmKmvvjYztj563NneRFMpQuTaVo6Zmkee3gftByFW4mgqYrsH4JQBFm3muCMtGwBRKxLBqdm0Sz3VOaS5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcBGsaNXRSQmfKpNmHAEaVZ120Ho0faji/1DFqduipx5F9Kj2eUmcLGdgvb0QKsY2vitpqZ32XiZ4r4t75RKoMSlBsSKMP5ZjnbOvhJtib9B0b/FLyiGoQQIMEfCOYO2Db+AFUP6AxoUqNBqIEBo4D7g4qXYizKyF771oN3hbF/FQwqgbt5cnU1Aev4S9h0wbwTJuNCyd4PnjBBo2hvEEx29FIzFZZd7AUIhGG/f9YS5C+wIdnjl6i6EsufNN/eETxOZZqSheXcLLzn9G+TO4EeLIodZiZoxAYCF/pud8orEKG24zWYi6bNcg+moXt8/rpXbaLkqJeIoGzQRPFkd738ClvMW+yNUDmuKY1xmXdvtj4XoPwEdVtZHPxa6tABIZEWobIxh5CdCY495Ij9mqi1jFsnHLiYNP48NzvnoCfbAh/a3M13Mijct5n4+zGskka3y4WVAwYvQixFBQkhX1SyH5BcW1d8dvHv8lPxshJ6C9xCKdspDqFeLFrl9IU9y9l9lYF1p7XyZvXfqaz7bzDWV1ZsxhEVMwkVIiyUHch2E+omwR5JjY0+HmiXQAbnzAoP/+AJPZU6tSRENx5y8rRviuK76d/saDudaUZJ/aVG3t6J/kOPKlBg1g5LTr5sXnww/7PqbmH+eGfOBydu4eyfa7jbLmdE6AfYeO3kHs3hn6/nlwDKvYpStvWUHdeRdWe2zdKjQYeBAd+A+4OA
When I use the example of google on this link:
https://cloud.google.com/speech-to-text/
When I upload my audio file and I look the request sent I see that their content is not the same:
UklGRqTjBQBXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAAZGF0YYDjBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
The google example works. Mine doesn't work.
Is the encoding different? if so, what is the encoding?
I use base64.exe for transcribe my audio file to base64.
Thanks
I found the solution.
I was using the js MediaRecorder library to generate my flac audio file but it is not compatible for google cloud speech. When you upload it on the example of google cloud speech it modifies the file to make it compatible.
So I changed the library to generate my file, I used recorder-js.
https://www.npmjs.com/package/recorder-js
It is working now.

Is it necessary to convert an image from gallery to base64 before uploading to amazon s3 server?

A requirement for my mobile application is that I need to allow a user to select a image from their camera roll, and upload it to a s3 server.
In react native, i send a http request to an endpoint I created, in which a file is uploaded to amazon s3.
When sending the http request, i require to set a parameter to a file (The one a user selects). Do i need to change that file into a base64 format, and then send the http request, or can i just send the file as it is without any modifications?
You can store your file as is in S3 (binary).
Whether your choose to upload it as base64 or binary depends on your application requirements only. S3 will take both.

Resources