I am developing a service which converts uploaded video to hls stream using elastic transcoder. uploaded video can vary the resolution. I have to generate streams based on resolution of video.
for example if original video is full hd(1080p) then I want to generate 240p, 360p, 480p, 720p and 1080p streams but if original video is 360p then i want to generate only 2 streams 240p and 360p since it wont make sense to generate higher quality by stretching.
I am able to define presets to generate fixed length playlist. How can make is variable based on video.
One way could be to make different presets and parse video to read resolution then choose presets accordingly. could there be some better approach or something provided by transcoder?
thanks
Related
I'm trying to add images to a video using mediaconvert. I used mediaconvert graphic overlay/ image inserter to perform this task. However, the image is overriding the given video in the output for the given duration. I want the image to be still at first and then start the video from the beginning if I add an image and similarly for the rest of the images. Can this be done by using aws-mediaconvert?
Overlays are normally used for things like watermarks and logos or simple sports scores/news tickers etc. Images you want to appear over the top of the video.
You could create a clip of blank video to insert into your output, then apply the overlay to just that?
Another option is to convert the image to a video yourself with ffmpeg and insert that into your output?
Some background:
I am attempting to create a DirectShow source filter based on the pushsource example from the DirectShow SDK. This essentially outputs a set of bitmaps, each of which can last for a long time (for example 30 seconds), to a video. I have set up a filter graph which uses Async_reader with a Wave Parser for audio and my new filter to push the video (the filter is a CSourceStream and I populate my frames in the FillBuffer function). These are both connected to a WMASFWriter to output a WMV.
The problem:
When I attempt to seek through the resulting video, I have to wait until a bitmap's start time occurs before it is displayed. For example, if I'm currently seeing bitmap 4 and skip back to the time which bitmap 2 is displayed the video output will not change until the third bitmap starts. Initially I wondered if I wasn't allowing FillBuffer to be called enough (as at the moment it's only once per bitmap) however I have since noted that when the audio track is very short (just a second long perhaps), I can seek through the video as expected. Is there a another way I should be introducing audio into the filter graph? Do I need to perform some kind of indexing when the WMV has been rendered? I'm at a bit of a loss...
You may need to do indexing as a post-processing step. Try indexing it with Windows Media File Editor from Windows Media Encoder SDK and see if this improves seeking.
Reducing key frame interval in the encoder profile may improve seeking. This can be done in Windows Media Profile Editor from the SDK. Note that this will cause file size increase.
Are there any good examples on how to create a WebM video file suitable for streaming to a web browser using the open-source WebM encoding library? Where should I begin? I am the owner of a small business, so I don't want to get into legal issues with FFMpeg, and I can't seem to figure out how the vpx_encoder.h is supposed to work. I am also interested in performing the reverse to create a video player in my application. I realize my question is similar to this one, however, I found neither of the two answers satisfactory.
To be more specific; the images are coming from a GDI+ bitmap object.
Take a look at my code, I used DEVIL to handle image file and manually convert pixels from RGB to YV12.
http://code.google.com/p/ortholab/source/browse/WebMEnc/WebMEnc.cpp
Normally, I can get a still snapshot from an IP camera with a vendor provided url. However, the jpegs served this way are not of good enough quality and the vendor says there is no facility provided for serving snapshots in other image formats or smaller/lossless compression.
I noticed when I open an rtsp h264 stream from the camera with VLC then manually take a screenshot, the resulting image has none of the jpeg artifacts observed previously.
The question is, how would I obtain these superior snapshots from an h264 stream with a c++ program? I need to perform multiple operations on the image (annotations, cropping, face recognition) but those have to come after getting as high quality as possible initial image.
(note that this is related to my previous question. I obtained jpeg images with CURL but would now like to replace the snapshot getter with this new one if possible. I am again running on linux, Fedora 11)
You need an RTSP client implementation to connect to the camera, start receiving video feed, defragment/depacketize the video frame and then you will get it and save/process/present as needed.
You might want to look towards live555 library as a well known RTSP library/implemetnation.
I am looking for a fast way to load in a video file and to create images from them at certain intervals ( every second, every minute, every hour, etc.).
I tried using DirectShow, but it just ran too slow for me to start the video file and move to a certain location to get data and to save it out to an image. Even if I disabled the reference clock. Tried OpenCV, but it has trouble opening the AVI file unless I know the exact codec information. So if I know a way to get the codec information out from OpenCV I may give it another shot. I tried to use FFMPEG, but I don't have as much control over it as well as I would wish.
Any advice would be greatly appreciated. This is being developed on a Windows box since it has to be hosted on a Windows box.
MPEG-4 format is not an intra-coded format, so you can't just jump to a random frame and decode it on its own, as most frames only encode the differences from one or more other frames. I suspect your decoding is slow because when you land on a frame for which several other dependent frames to be decoded first.
One way to improve performance would be to determine which frames are keyframes (or sometimes also called 'sync' points) and limit your decoding to those frames, since these can be decoded on their own.
I'm not very familiar with DirectShow capabilities, but I would expect it has some API to expose sync points.
Also, I should mention that the QuickTime SDK on Windows is possibly another good option that you have for decoding frames from movies. You should first test that your AVI movies are played correctly in the QuickTime Player. And the QT SDK does expose sync points, see the section Finding Interesting Times in the QT SDK documentation.
ffmpeg's libavformat might work for ya...