Telegram bot sendVideo aspectRatio - telegram

I use sendVideo method with file url, so telegram automatically create preview for my video, determines duration and aspect ratio of preview.
But it incorrectly determines aspect ratio of preview, so it looks weird. (I suspect that it has some problem with this task, because all wrong sizes are square ( default aspect ratio))
Is there any approach to fix this issue ? I have tried to manually set width\height in api call, but telegram does not respect this parameters.

I have opened my video with HandBrake program and I've found, that it has different storage size and preview size (because of me, truncating this video).
Telegram respects storage size, so I processed my video with HandBrake to achieve equal sizes, after that preview of my video became correct.

Related

Youtube not loading high resolution thumbnail

I'm loading few videos with iframe on a page. Those videos have custom high Quality thumbnails that we've uploaded in youtube. We have the player in 1280px wide and it for the most of the time it doesn't load the max res thumbnail, but it goes for a low quality thumbnail.
So far I've been unable to understand how youtube decides which thumbnail to load. For the last couple of days it was loading the high quality thumbnail in firefox & IE, but it was taking the low resolution for chrome. Today it is the same in all browsers -> it loads the low quality image.
If you want to see it for yourself here is the site:
http://wingtsun-akademie-heidelberg.de/new/
I've tried to force hd quality with the js iframe api:
player = new YT.Player(el, {
height: 1080,
width: 1920,
hd: 1,
events: {
'onStateChange': onPlayerStateChange
}
});
But it doesn't seem to have any effect? Do you have any idea if I can load a custom thumbnail by providing it to the player object?
Right now it seems that youtube loads most of the time:
http://i3.ytimg.com/vi/WqK2IlP-JSE/hqdefault.jpg
instead of:
http://i3.ytimg.com/vi/WqK2IlP-JSE/maxresdefault.jpg
Thanks in advance for any suggestions.
this is what youtube API states for maximum resolution thumbnails:
maxres – The highest resolution version of the thumbnail image. This image size is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 1280px wide and 720px tall.
Important is the quote "available for some videos". So NOT at all EVERY youtube video serves a maxres thumbnail to third parties.
The reason for this is unknown. Seems as if the availability of maxres thumbnails comes randomly. I have hand-checked maxres thumbnails for several thousand youtube IDs and couldn't find a pattern. Some have maxres and round-a-bout at least a third of all videos checked just don't serve a maxres whatever the resolution of the video is. So one has to assume Youtube is willingly annoying third parties for a reason. You may speculate yourself why 'they' are doing this...one might think it's one of the easiest things to always generate a maxres pic for every video. But...they don't let their system generate them.
Your website seems to be using the right thumbnail now... I guess your problem is fixed?
YouTube recently changed the way thumbnail ids are retrieved. It is now using a key-value map rather than a list, which means you can now longer rely on the first one being this size etc... so maybe that was a problem with this, if you switched the API level from 2 to 3.

How to resize Video capture in DirectShow?

I've look around in the documentation but can't find a good way to do this.
I capture video from my webcam and connect it to a ISampleGrabber filter to take screenshots. Which works fine but I would like to be able to scale the resolution on the video.
Thanks for any guidance!
Resizing in software is a relatively expensive operation, for which you also don't have an out of the box working component in DirectShow. You are typically more interested in setting proper capture resolution in first place, so that you don't need to resize.
Can't change video capture resolution using c#
Video Capture output always in 320x240 despite changing resolution
To resize video on runtime, you need either third party filter, or a custom filter, or instead copy a video from DriectShow pipeline and resize it there e.g. using StretchBlt API.
You can do the re-sizing job by manipulating the bitmaps you captured from directshow and then push them to new video file. However I generally do not recommend that .
FFmpeg already have this function integrated.
ffmpeg -i input.avi -s [width]x[height] output.avi

Apply a Filter to a Camera video stream publishing to Media Server

I am Trying to Apply some information Like text and An Image as an overlay to create a overlay effect as lice a security camera with time and date on the video along with a png based Logo.
I can record VIDEO Using Flex and FMS or any other Media Server. But I want to save a modified version of the stream being uploaded.
Use camTwist (mac) or webcammax (pc) as your video input...you can use that program to use the webcam and then add whatever over it (text, date). Use Flash Media Live Encoder and select camTwist as your video source. Stream and save your recordings using that FMLE.
Sorenson Squeeze is pretty awesome for this and is cross platform. Camtwist is cool but it's not really a 'pro' app, that makes me sound way snobbish. It's actually pretty fun and a good suggestion for a simple result but I haven't found anything better than Sorenson Squeeze for the features and control it gives you.

Screen resolution

how can I replace screen resolution when accessing some site from script? Is it possible to acces such data when own script connects to the server?
To give a very definitive answer:
You cannot change a user's screen resolution via the browser.
You cannot retrieve a user's resolution as part of any ordinary HTTP request. (i.e.: in PHP's $_POST superglobal)
You can retrieve a user's screen resolution using JavaScript, which can then be passed back to the server via AJAX.
As a best practice, your website should be resolution independent by means of a fixed, fluid, or elastic layout. Changing a user's resolution is a frustrating experience for users and makes a project operate badly.
Keep in mind, also, that many platforms cannot have their resolutions altered. Most mobile devices, embedded platforms, and video game consoles have fixed resolutions. Also, projectors and televisions usually have very specific resolutions at which they function properly, so adjusting the resolution on these devices would likely wreak havoc.
As an alternative to adjusting screen resolution, check out em-driven layout. An em is a unit of measure in CSS that is relative to the current font. This allows you to dynamically adjust the sizing of your layout and its contents by adjusting the font size of the document (a larger font size will increase the pixel-for-pixel sizes of everything else on the page).
It should be noted that adjusting resolution can be accomplished via ActiveX on Windows, but only after multiple security warnings (and it only works on Windows in IE). This should not be attempted under any circumstances.
Here is my answer if I understood your question correctly. It is not possible to change screen resolution for a user when he/she accesses your site.
Are you saying that the site is changing its behavior based on what it thinks the user's screen resolution is? That's a) bad behavior, and b) client-side, so done with JavaScript or an ActiveX control or the like.
If you want your script to mimic that, it'll have to interpret the JavaScript, run the ActiveX, or whatever.
Sites don't have their own "screen resolution". They're rendered to whatever size the browser is at. That's part of the beauty of HTML.

How to make the render filter not to maintain the aspect ratio?

I have write a DirectShow video transform filter, which is inserted between a video decoder and a video render filter. It will add a photo frame around the input picture. So the output picutre's size and aspect ratio is different from the input one.
Unfortunately, I found the video render would maintain the original aspect ratio and so the displayed picture with a photo frame was stretched. In GraphEdit, I found the video render filter with a check box named "Maintain Aspect Ratio". Uncheck it and the out picture will not be stretched. That's what I want. But I don't know how to do it in my code. I had query the interface IVideoWindow but found it wasn't able to set the aspect ratio. So I ask for help here.
Thanks.
Thank you, Jeremiah Morrill. Yes, IVMRAspectRatioControl7/9 is what I want. But it seems, to get the interface, I must get the filter Video Mixing Renderer Filter 7/9 firstly. I want to set the aspect ratio on the "Video Renderer" filter instead of "Video Mixing Renderer Filter 9".
I don't need to chage format dynamicly. My filter graph is
Source -> Demux -> Decoder -> MyFilter -> VideoRenderer
No matter the Decoder output's resolution, MyFilter's output resolution is always same as the desktop screen. I found, if I use intelligence connection, I will encounter the problem I have described. But if I connect MyFilter to VideoRenderer manually, the video resolution is correct, i.e., same as the screen.
Maybe you are looking for IVMRAspectRatioControl7/9 interface (queried out of the VMR renderer)?
Also, what you are describing sounds very odd. Is your output pin supplying the correct video sizes in the media type after the input pin media type is set? Also, if you are changing resolutions after the pins are hooked up, you may want to read about dynamic format changes.

Resources