Showing posts from May, 2020

My note on ffmpeg usage

Most Common Basic Usage to burn subtitles into video ffmpeg -i input.mp4 -vf subtitles="" output.mp4with gpu ffmpeg -i input.mp4 -c:v hevc_amf -vf subtitles="" output.mp4
ffmpeg -i input.mp4 -c:v h264_amf -vf subtitles="" output.mp4 ffmpeg -i input.mp4 -c:v h264_nvenc -vf subtitles="" output.mp4 Use this command to list down gpu option availableffmpeg -f lavfi -i nullsrc -c:v h264_nvenc -gpu list -f null -

Below is the RAW note which I haven't tidy up.
Bash Shell Script for convert media file in batch.
for f in *.flv
#echo $f
#echo ${f%.*}
ffmpeg -i $f ./done/${f%.*}.mp4

rename 's/ACDC/AC-DC/' *.xxx

To replace # by somethingelse for filenames in the current directory (not recursive) you can use the GNU rename utility:

rename  's/#/somethingelse/' *

Characters like - must be escaped with a \.

ffmpeg -i orig.mkv -filter_complex "[0:v][0:s]overlay=(W-w)/2:(H-h)/10*9[v]" -map "[v]" …

Connect 2 monitors to Dell Laptop G3 15 on Fedora 32

If you are trying to connect 2 monitors (HDMI + USB C), you might find that only USB C and the laptop monitors is working in Fedora 32. After I search around, here is the simple solution.
Create a file (any file name end with extension .conf) under folder /etc/X11/xorg.conf.d.
I name it 11-nvidia-prime.conf. (Copy from ubuntu). Enter the lines below and reboot. 
[root@localhost xorg.conf.d]# cat 11-nvidia-prime.conf
Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
I believe this solution should be working for Fedora 25 and above.
Leave me a message if you have question.