2021. február 23.

How to split a video without rerendering it

To slice out a part of a video file, we can use this ffmpeg command:

ffmpeg -ss <position> -i input.mp4 -c copy -t <duration> output.mp4

-c copy Copy is a special value for the codec option on the output to indicate that the stream is not to be re-encoded.

-ss <position> When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When doing stream copy or when -noaccurate_seek is used, this extra segment between the seek point and position will be preserved.

-t <duration> When used as an output option (before an output url), stop writing the output after its duration reaches duration.

position/duration can be in either the [-][HH:]MM:SS[.m...] or the [-]S+[.m...][s|ms|us] format

2021. január 4.

Note: How to password-protect a PDF file on Ubuntu

This is a copy of this post for safe-keeping: 


In a terminal, type:

sudo apt-get install pdftk

Then, to add a password to a PDF file, type:

pdftk <input-file> output <output-file> user_pw <password>

Example:

pdftk input.pdf output output.pdf user_pw 1234