Tags » Ffmpeg

ffmpeg x265 convert

Convert all filename.mkv files in current folder into filename-$crf.mp4 files.
Copy audio track.


for f in *.mkv

	ffmpeg -i "$f$oldext" -c:v libx265 -preset $preset -crf $crf -c:a copy "$f""-""$crf$newext"

… 45 more words

How to 'embed' subtitles into mp4 video

If you ever want to embed or burn subtitles into an mp4 video file, just use ffmpeg. See below:

ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text outfile.mp4

One-bash-liner to get rid of .WMV container

For reasons known probably to only a very few, selected ones – videos contained in the “.WMV” container seem to have occasional problems with seeking and positioning when played back with XBMC (or “Kodi” if you adapted to the brave new name). 69 more words


How to create ABR content with FFmpeg in one pass

I was once informed that it would be nigh impossible to create ABR content in one pass using FFmpeg.  Challenge accepted!

I remembered that statement when I wanted to calculate a bit per pixel density encoding matrix for different video resolutions.  1,125 more words


Compiling mpv for MacOS X

It has been a long time since my last posting and I am still building ffmpeg/mpv for personal use. As I do not clearly explain how to build mpv in a previous blog article… 1,351 more words


Creating a video montage with ffmpeg

With 1080p (and in some cases 2K) cameras now being standard on mobile phones, it’s easier than ever to create high quality video. Granted, the lack of quality free video editors on Windows / Linux leaves something to be desired. 1,249 more words


Fraktalismus Outtakes: Sea Monsters

Sea Creature 1

// seacreature1.c - Creates a fractal "sea creature"
// Written by Ted Burke, last updated 3-8-2016
// gcc seacreature1.c -o seacreature1 -lm
// ./seacreature1
// ffmpeg -framerate 20 -i %03d.pgm seacreature1.gif

#include <stdio.h>
#include <complex.h>
#include <math.h>

#define W 640
#define H 640

void main()
    unsigned char pixels[H][W];
    // n is used to count iterations of the iterating function
    // x and y and pixel coordinates
    // t is frame number and T is the total number of frames
    // z and c are the complex variables in the iterating function
    // pwx was originally pixel width, but isn't exactly that now
    int n, x, y, t, T=100;
    complex double z, c;
    double pxw = 4.0 / H;
    char filename;
    FILE *f;
    // Generate all frames in the animation
    for (t=0 ; t<T ; ++t)
        // Calculate pixel values for current frame
        for (y=0 ; y<H ; ++y) for (x=0 ; x<W ; ++x)
            c = cexp(I*(t*M_PI*2.0/T)) * cpow(pxw * ((x-W/2) + (y-H/2)*I), -3.0 + 0.0*creal(cexp(I*(2.0*M_PI*t)/(0.5*T))));
            z = -0.25 + 0.25*cexp(I*(2.0*M_PI*t)/(0.5*T));
            for (n=0 ; n<50 && cabs(z)<4.0 ; ++n) z = z*z + c;
            pixels[y][x] = 5*n;
        // Write current frame to PGM image file
        sprintf(filename, "%03d.pgm", t);
        fprintf(stderr, "Writing %s...", filename);
        f = fopen(filename, "w");
        fprintf(f, "P5\n%d %d\n255\n", W, H);
        fwrite(pixels, 1, W*H, f);
        fprintf(stderr, "DONE\n");
… 248 more words