How the Hell did I do that?
Monday, June 28, 2021
Convert Unix epoch timestamp to human-readable date
In:
Out:
Source:
https://unix.stackexchange.com/questions/2987/how-do-i-convert-an-epoch-timestamp-to-a-human-readable-format-on-the-cli
date -r 1581700603
Fri Feb 14 18:16:43 CET 2020
Source:
https://unix.stackexchange.com/questions/2987/how-do-i-convert-an-epoch-timestamp-to-a-human-readable-format-on-the-cli
Saturday, April 24, 2021
How to concatenate videos with ffmpeg
This one works for me:
ffmpeg -i input1.mp4 -i input2.webm -i input3.mov \ -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0][2:a:0]concat=n=3:v=1:a=1[outv][outa]" \ -map "[outv]" -map "[outa]" output.mkv
Reference: https://trac.ffmpeg.org/wiki/Concatenate
It assumes the videos have the same size and TBR. To transpose a video when one is vertical and another is horizontal, see here.
When video TBRs are different, it may come up with the strange message:
"More than 1000 frames duplicated"
When this happens, try adding "-vsync 2" to the command. Reference: https://stackoverflow.com/questions/62822889/ffmpeg-filter-complex-concat-never-completes. It worked for me.
How to transpose a video with ffmpeg
ffmpeg -i input.mp4 -vf "transpose=1" output.mp4
or
ffmpeg -i input.mp4 -vf "transpose=clock" output.mp4
for one 90-deg clockwise rotation.
Monday, April 5, 2021
Combine image + audio file to make a video
I tried at least 5 commands from different sites, and only this one worked well enough for me - about 37x speed, waitable.
ffmpeg -loop 1 -f image2 -r 2 -i image.jpg -i audio.m4a -c:v libx264 -c:a copy -shortest video.mp4
Wednesday, February 3, 2021
How to prevent Automounting of Volumes (USB drives, optical discs, etc) upon connecting on Mac OS X
https://discussions.apple.com/docs/DOC-7942
- diskutil info /Volumes/<volume that shouldn't be mounted>
- Get UUID from output from above step 1.
- sudo /etc/vifs
- Add this to the file:
- UUID=<LONG-UUID-LIKE-F77F-3F72-A6C2-26676F39B7CE> none hfs rw,noauto
- sudo automount -vc
Saturday, December 26, 2020
ffmpeg aac -> mp3 conversion
It seems that it isn't easy to handle aac/m4a files in sox anymore. Online help threads suggest using ffmpeg to convert it to mp3 instead:
ffmpeg -i input.m4a -c:a libmp3lame -q:a 8 output.mp3
Reference link: https://askubuntu.com/questions/1200430/how-to-convert-m4a-audio-files-to-mp3-use-command-line
Subscribe to:
Posts (Atom)