set unique value for size of mp4 - mp4

What I want to do is to have my mp4 always display the same size as if the user double-clicked on the mp4 while it was playing (i.e., with the black bars top and bottom), rather than opening up full screen.
How can I display the mp4 as described to begin with and not allow the user to change it?
My best guess is to change the frame size, but I am not certain this is the optimum approach.

Related

Agora Video Resolution In Unity

I'm working on an app that uses agora sdk for unity. I'm rendering video on UI Raw Images and using a video resolution of 480x480. The thing is that the video in those images looked a bit stretched and to handle that I set the orientation to fixed portrait and it looks better but not perfect. So I want to ask, do I need to resize the images according to video resolution i.e. if video resolution is of 480x480 then the raw image size should be 480x480 in width and height as well? I also need to present a user's video in a much larger image so what video resolution should I choose given the size of raw image 980(w) x 1600(h). I just need the videos to best fit the images so it looks good. Any help would be much appreciated.
Yes, you should resize the image according the resolution in general. There is a callback method that tells what the video resolution size is. You may find that information in VideoSurface's code where reference to UpdateVideoRawData() is. The actual Raw Image itself doesn't have to match the size and the data will fill in within boundary. You should maintain a width/height ratio. Or if you want to crop the image, you may need to apply some masking technique. Crop the video data itself maybe another approach but that will add CPU overhead for you.

How to put image as letterbox in video

When I converted my video using Azure Media Services to format 9x16 letterboxes appeared in the top and the bottom. I used stretchMode: "AutoFit" so letterbox is actually a normal effect here.
Pad the output (with either letterbox or pillar box) to honor the output resolution, while ensuring that the active video region in the output has the same aspect ratio as the input. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box regions 280 pixels wide at the left and right.
However I wonder if this is possible to put an image there instead of having them just black.
My video looks like this:
No, we do not currently support placing background images during a stretch or letterboxing operation. If possible, and you do not have a ton of these videos to process, I recommend running them through a free compositing application like BlackMagic's Davinci Resolve to get the intended effect and then uploading the final output for streaming.

how to use melt to do video overlay? It's just like a PiP(picture in picture)

I want to use melt.exe (command line video editor) to do something with video overlay. It's like overlay a video on the other that I can control the size and position of the video which will be placed. I have done this with shotcut and view the xml it generates.
But I want to know how can I do this with melt command script. Or if I have known all the information about video overlay such as in/out points, size, position, and how to create a xxx.mlt(xml) file according to these info?
I got the three videos overlaied to generate one like this :
final effect
I use shotcut to do this and I get a .mlt file. sorry I don't know how to upload the xml file or maybe it can't be.
So I want to know how to do the same thing with melt.exe?

Text overlapping in video processing Matlab

I'm a fresher to matlab, and I'm trying to extract text from video using ocr methods. My problem is, there is same text appearing in consecutive frames, and sometimes when camera is panning new parts of already extracted text will reveal and I have to add those to already extracted text. Both makes it difficult to store a text only once if it appear in video once while playing. Text usually are name boards or road side boards having text which are captured in the video. How to solve this problem?

MPEG-4 file behavior

In iphone i have a mpeg-4 video file, which when played & when i click in the middle or any portion of the video, its goes back & starts from beginning rather continuing from the place where i clicked.
Whereas the same file plays when the same behavior is extorted(ie. play, click in the middle of the video) works fine in quicktime player/safari.
Do someone have any thoughts on this?
The video proabably only has one keyframe at the beginning of the clip.
That means to recreate the image in the middle of the video, the player needs to go back to the first frame and apply the rules from every spanning frame. A good video player on powerful hardware would be able to calculate what the 20,000th frame on the fly essentially by playing the entire video to that point. However, that is quite a lot of calculation, so a less powerful video player (like one on a phone), would not be able to make all of the necessary calculations in a timely manner much faster than real time, so it might simply go back to the beginning.
One solution would be to put key-frames more frequently. That way you have a higher seek precision. Every 1-2 seconds is pretty standard and used by DirectTV (That is why it can sometimes take a second to change the station. Th box can't render the image until it receives a keyframe.)
A little explanation of keyframes...
If you don't know what a keyframe is, you need to understand a little about video compression. An uncompressed video would store the complete image for each frame. So, 30 frames would be the equivalent of jpgs (or other image format).
One of the larges gains in compression comes when, instead of storing the complete image in each frame, you only store the information that was different. For example, if you have a static scene and a ball flies through it, you only have to describe the path of the ball.
There are many rules for this calculation. Some of the rules are philosophically similar to the manner in which traditional animators layered cels above a static background. Other rules more resemble the way William Kentridge modifies the previous frame in his charcoal animation by panning, erasing, or drawing over.
Here is a good explanation of the mpeg-4 standard