Thursday, 26 December 2024

Concatenating video files

For video files that come in part, use ffmpeg to merge them into 1 file

Eg: part1.mp4, part2.mp4, part3.mp4

Create a concat file - list.txt

file 'part1.mp4'
file 'part2.mp4'
file 'part3.mp4'

Use ffmpeg to merge into full.mp4

ffmpeg -f contact -safe 0 -i list.txt -c copy full.mp4

If you have subtitles create an additional concat file - subts.txt

file 'part1.mp4.srt'
file 'part2.mp4.srt'
file 'part3.mp4.srt'

Then use ffmpeg to create the full file

ffmpeg -f concat -safe 0 -i list.txt -f concat -safe 0 -i subs.txt -map 0 -map 1 -c copy -metadata:s:s language=eng -metadata:s:s title=English full.mp4

The title= seems to be necessary when doing subtitles and it names the subtitle track.

Sunday, 17 November 2024

MFA with Google Authenticator

 Set server up so user can log in with an ssh key or Google authenticator (won't need both). 

If a user doesn't have key access setup they'll have to use Google Authenticator, they won't be able to log in with a password

The user still needs to type the password to log into cockpit

/etc/ssh/sshd_config
ChallengeResponseAuthentication yes
# Uncomment this to force google authenticator AND a public key
#AuthenticationMethods publickey,keyboard-interactive

/etc/pam.d/cockpit
# google authenticator for two-factor
auth  required  pam_google_authenticator.so secret=/home/${USER}/.ssh/.google_authenticator

/etc/pam.d/sshd
#Commented out to not allow passwords
#auth       substack     password-auth
# Use Google authenticator for login
auth       required     pam_google_authenticator.so nullok secret=/home/${USER}/.ssh/.google_authenticator

To setup a user with Google Authenticator make sure to use the -s option
 google-authenticator -s /home/test/.ssh/.google_authenticator