sprintf / snprintf Problem on Arduino.

What a day. Spent the day hunting a bug in my code, only to find out that it wasn’t in my code. (Update: Turns out my code was wrong in two ways, more below the original entry.) (Update 2: There are options to set this in the Arduino IDE Preferences)

There’s an error in the sprintf and snprintf implementation on Arduino that occurs when more than 8 varargs are passed in after the format specifier.

Continue reading sprintf / snprintf Problem on Arduino.

ffmpeg: Stripping Audio and Scaling Down Video

Rather than use animated GIFs when I’m trying to show a video without sound, I prefer to use ffmpeg to strip out the audio and scale down the video. I’ve looked this command up way too many times:

ffmpeg -i test.mp4 -c:v libx264 -profile:v baseline -vf scale=640:-1 -an test-640.mp4

Update 7 October 2018:

Twitter has some video requirements such as a maximum framerate, that need to be accounted for:

ffmpeg -i test.mp4 -c:v libx264 -profile:v baseline -vf scale=540:-1 -t 30 -r:0.0 30 test-540.mp4

The above command will rescale the video to a quarter of Full HD resolution in portrait orientation, set a duration of 30 seconds (the -t option) and set the output video stream 0.0 framerate to 30 frames per second.

Update 2 July 2019:

ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -vf scale=1280:-1 -an -ss 5.5 test-1280.mp4

Set the start time at 5.500 seconds and scale to 1280px width.

ffmpeg -i input.mp4 -vframes 1 -vf scale=1280:-1 “poster.jpg”

Create a poster image for the video file.

Update 30 August 2019:

Measure-Command { ffmpeg -i video-nonoisereduct-noedgeenhance-with-log-medium.mp4 -c:v ffvhuff -an -filter:v “scale=640:-1” test-output-ffvhuff-640.mkv }

Measuring the amount of time ffmpeg takes to transcode on Windows using Powershell (similar to the time command on Linux).

This was a test of ffvhuff as a codec, and pushing the file down into a proxy-file sized format, something I’ll be learning more about in the future.