video-encoding
How to encode Bitmaps into a video using MediaCodec?
I have modified the code provided by abalta to accept bitmaps in realtime (ie you don’t already need to have the bitmaps saved to disc). It also has a performance improvement since you don’t need to write then read the bitmaps from disc. I also increased the TIMEOUT_USEC from the original example which fixed some … Read more
How to disable subtitles decoding in ffmpeg
I’ve finally found an answer. There is such option as -sn which disables subtitles decoding from input stream. Also there are analogous options for audio and video decoding: -an and -vn respectively. It also turned out that there is another way to achieve this. One may use the -map option to select which streams are … Read more
Suggested Compression Ratio with H.264?
In a quite interesting document called H.264 Primer, a simple formula is given as an hint to compute the `ideal’ output file bitrate, based on the video’s characteristics: [image width] x [image height] x [framerate] x [motion rank] x 0.07 = [desired bitrate] where the image width and height is expressed in pixels, and the … Read more
Is there a way to use ffmpeg to determine the encoding of a file before transcoding?
Use ffprobe Example command $ ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 input.mp4 Result h264 Option descriptions -v error Omit extra information except for fatal errors. -select_streams v:0 Select only the first video stream. Otherwise the codec_name for all other streams in the file, such as audio, will be shown as well. -show_entries … Read more
Encode a series of Images into a Video
I agree with Mark. Among the C/C++ libraries are ffmpeg here or X264 here. I have to say I havn’t found them or the Android NDK easy to use but that’s probably because I don’t really know much about C/C++ and JNI. If you’re interested in this route, then the RockPlayer free app for Android … Read more
Extracting frames from MP4/FLV?
The command ffmpeg -ss 00:00:25 -t 00:00:00.04 -i YOURMOVIE.MP4 -r 25.0 YOURIMAGE%4d.jpg will extract frames beginning at second 25 [-ss 00:00:25] stopping after 0.04 second [-t 00:00:00.04] reading from input file YOURMOVIE.MP4 using only 25.0 frames per second, i. e. one frame every 1/25 seconds [-r 25.0] as JPEG images with the names YOURIMAGE%04d.jpg, where … Read more
Choosing a video codec for screen recording
Master copy Lossless – HUFFYUV in AVI is a good option. Lossy – MJPEG (series of JPEG) in AVI is a good option, where each frame will be independently encoded. The editing will be faster. Distribution Video codec – Use either H.264 video (not free) or VP8 (free video codec by Google). You should use … Read more
FFmpeg output file format with no extension
Use the -f parameter to tell ffmpeg which output-format to use. E.g ffmpeg -i input.mpg … -f mp4 output to create a file named output in mp4 format.