concat_mp4.sh
#!/bin/bash
# usage ./concat_mp4.sh input1.mp4 input2.mp4 output.mp4
ffmpeg -i $1 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i $2 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc $3
inspiration: https://trac.ffmpeg.org/wiki/Concatenate
Sunday, May 24, 2020
Sunday, May 3, 2020
Friday, April 24, 2020
convert .ogv to .mp4
ffmpeg -i vid.ogv -crf 18 vid.mp4
https://stackoverflow.com/questions/37325629/efficient-ogv-video-conversion-in-linux
https://stackoverflow.com/questions/37325629/efficient-ogv-video-conversion-in-linux
crop video with ffmpeg
$ ffmpeg -i in.mp4 -vf "crop=w:h:x:y" out.mp4
* for screen captures, the true size of capture may be lower than sreen size, check the stdout of a failed conversion to see this:
* for screen captures, the true size of capture may be lower than sreen size, check the stdout of a failed conversion to see this:
Tuesday, April 7, 2020
python unzip list
for pairs of values:
[(key1, val1), (key2, val2), ...]
[keys, values] = list(zip(*KeyValueList))
https://www.geeksforgeeks.org/python-unzip-a-list-of-tuples/
[keys, values] = list(zip(*KeyValueList))
https://www.geeksforgeeks.org/python-unzip-a-list-of-tuples/
C++ static methods in template classes
In C++, when declaring a static method in a templated class, it is mandatory that the definition of the function be placed in the .h file, not the .cpp file.
Friday, April 3, 2020
Ubuntu update history
$ /var/log/apt/history.log https://askubuntu.com/questions/14328/where-can-i-look-up-my-update-history
Subscribe to:
Posts (Atom)