x264
How to encode a video from several images generated in a C++ program without writing the separate frame images to disk?
After some intense struggle, I finally managed to make it work after learning a bit how to use the FFmpeg and libx264 C APIs for my specific purpose, thanks to the useful information that some users provided in this site and some others, as well as some FFmpeg’s documentation examples. For the sake of illustration, … Read more
How to get h264 video info?
I’ve found out that the best way for this is using FFprobe with -show_streams parameter. It shows both h.264 profile and B-frames usage for video streams of the movie. ffprobe -show_streams -i “file.mp4” [STREAM] index=0 codec_name=h264 codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 profile=High codec_type=video codec_time_base=1001/48000 codec_tag_string=avc1 codec_tag=0x31637661 width=1920 height=1080 has_b_frames=0 sample_aspect_ratio=0:1 … Read more
h264 lossless coding
I am going to add a late answer to this one after spending all day trying to figure out how to get YUV 4:4:4 pixels into x264. While x264 does accept raw 4:2:0 pixels in a file, it is really quite difficult getting 4:4:4 pixels passed in. With recent versions of ffmpeg, the following works … Read more
How does one encode a series of images into H264 using the x264 C API?
First of all: check the x264.h file, it contains more or less the reference for each function and structure. The x264.c file you can find in the download contains a sample implementation. Most people say to base yourself on that one, but I find it rather complex for beginners, it is good as an example … Read more
Generating movie from python without saving individual frames to files
This functionality is now (at least as of 1.2.0, maybe 1.1) baked into matplotlib via the MovieWriter class and it’s sub-classes in the animation module. You also need to install ffmpeg in advance. import matplotlib.animation as animation import numpy as np from pylab import * dpi = 100 def ani_frame(): fig = plt.figure() ax = … Read more
Unknown encoder ‘libx264’
I am using Ubuntu 11.04, and I also came across this error – Unknown encoder ‘libx264’. Installing the package libavcodec-extra-53 resolved the problem. In Ubuntu 14.04 LTS the package that is needed is called libavcodec-extra-54 (and libav-tools)