Name of original file in API - imgur

The API reference says, when requesting album images, it returs an image object for each image (https://api.imgur.com/models/image). About the name of the file uploaded, it says:
name string OPTIONAL, the original filename, if you're logged in as the image owner
There are differences when you upload the image via the web, mobile web, or the application; my question is related to uploading images via the web. When the image is a video (.mp4) the name is never available. When the image is a jpeg file, the name is always available (in my experience).
Is there a reason for this? It would be nice to have the file name in the video uploading case.

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 ?

Upload .VTT captions with Azure Media Service video streams

I am trying to achieve uploading an MP4 video to Azure Media services; making it available for streaming via a streaming URL, as well as more importantly and specifically to this question: upload .VTT captions to be shown within the video.
I have worked on integrating the code within this tutorial, more specifically the EncodeAndStreamFiles sample app (described in the document) as a DotNetCore API.
I have managed to retrieve a list of streaming URLs for the Video, and the stream works well (the video is playable).
The next step is uploading a .VTT caption (or subtitle). Unfortunately, I have not found any official documentation from Microsoft regarding this subject. This Stack Overflow question is the only useful information I found. Based on the answers to the question; I am uploading the caption within the same blob container as the video's output asset and referring to it by editing the video's streaming URL (replacing the last part).
So if the video's streaming URL is this:
https://azuremediaservicename-euwe.streaming.media.azure.net/2e262dca-23d9-453d-be00-6a7e60167ab7/HR%20documents.ism/manifest(format=m3u8-aapl)
Then the caption's streaming URL would be:
https://azuremediaservicename-euwe.streaming.media.azure.net/2e262dca-23d9-453d-be00-6a7e60167ab7/HR%20documents.vtt
I am trying to display the video and the caption using the advanced options within this tool. The caption appears within the options, but the actual words don't appear on screen.
I have 2 questions -
Is the uploading of the Caption as part of the blob container, the correct way to upload captions? Or is there a better way (perhaps via the SDK) that I haven't run into yet?
If the answer to 1. is Yes, how should the streaming URL for the caption be generated? Is the example shown above correct?
If you want to store the VTT file in the same storage container than the asset, and make it available as download, then you need to change the predefined policy to
StreamingPolicyName = PredefinedStreamingPolicy.DownloadAndClearStreaming
in line https://github.com/Azure-Samples/media-services-v3-dotnet-tutorials/blob/master/AMSV3Tutorials/UploadEncodeAndStreamFiles/Program.cs#L403
This approach works for clear content but not for protected (DRM) content. For protected content, you should use a separate container (or asset) for the subtitles files.

Is image or file being always downloaded from Google Cloud Storage on click?

Please help me to understand the following, I have a node.js app which I want to run on Google Cloud App Engine, this app will contain some images which are planned to be stored on Google Cloud Storage. On my sample app once I upload an image and get a url (mediaLink or selfLink) image is being downloaded.
Why is that? Each download each click costs money I understand google, but is there any way to make url just show images NOT to be downloaded?
Saving a file from Google Cloud Storage is the same as displaying it. Both action require transferring the content of the image to the device for display or saving.
The action of displaying an image or popping up a save as dialog is controlled by HTTP headers. For example if you have the HTTP header content-type set incorrectly (not as an image) then some browsers will save the file. If you want your image files to be displayed as images set the headers correctly for the type of picture. For PNG files set the header contenty-type: image/png.
You can also force a download with the content-disposition: attachment header.
In summary, it does not matter if you are displaying an image or saving it to local storage, it will cost you money. Both actions requiring downloading (transferring) the contents of the file across the Internet.

Bug with uploading using youtube API?

I'm uploading videos using youtube API v3.
All was Ok until I copied and renamed my video file via node js:
fs.createReadStream(old_path).pipe(fs.createWriteStream(new_path));
After it, after uploading, in my video manager page (https://www.youtube.com/my_video) I have error: "Upload failed: can't process file". But in my app i recieved video ID in response. I've uploaded that file several times with the same result. But luckily I have original (not renamed) file in my backup, and I uploaded it successfully.
By the way, when I tried to upload the renamed file manually (through the browser), it was successful.
p.s. When I use
fs.writeFileSync(new_path, fs.readFileSync(old_path));
for copying and rename files, uploading also was successful.
I tried to do it with a bunch of files, with same results.
Here is the reference post 1 and reference post 2 from YouTube help forum where the user has encountered the same issue.
The same issue was cited in the SO post as well.
Where the recommendation are the same as what I have given.
It's possible there's issues with the video file on the conversion
side of things.
Another reason maybe is the file format.
Currently the supported formats are listed below:
.MOV
.MPEG4
MP4
.AVI
.WMV
.MPEGPS
.FLV
3GPP
WebM
Try to check Recommended upload encoding settings for your videos on youtube as well.

Resources