Posts

Showing posts with the label Design

How to make small software project?

How to reduce the burden on developers, reduce software size, optimize program performance, and increase compatibility? For different hardware, systems, and architectures, build different software packages or repositories and let different programmers manage them. For example, vim can be divided into vim_linux, vim_windows, vim_mac, vim_android, etc. If need more precise, it can be divided into vim_linux_amd64, vim_linux_arm64 In this way, you may find that only the developers of Unix are the smartest, and their project have the least amount of code, and their software are most stable. If the project has 0 dependencies, in theory, in that hardware machine it targets to, you can use that software forever without updating or internet access. For people who are looking for general cross platform project, they are stupid. They do not own those hardware or operation systems, so they can't make sure in the future, those stuff won't change. So cross platform software is the most unsta...

What I have learned from the frontend development

1. Always add a loading indicator for any actions that consume your user's waiting time. 2. Always add a confirm window for an action that may risk users to make

How to show raw text in html with newlines

<pre> whatever text with newlines </pre>

Master FFmpeg

#### I just want to see my beautiful face ``` ffplay -window_title "yingshaoxo" -vf hflip /dev/video0 ``` ___ #### Maybe record my screen with my voice ``` ffmpeg -y -f alsa -i hw:0 -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0+0,0 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast ~/Videos/$(date +%F_%A_at_%H:%M:%S).mp4 ``` ___ #### You got it, I couldn't record without my beautiful face ``` ffmpeg -hide_banner -loglevel info -thread_queue_size 512 -y -f alsa -i hw:0 -thread_queue_size 512 -f x11grab -video_size 1920x1080 -i ":0.0" -thread_queue_size 512 -f v4l2 -video_size 320x240 -i "/dev/video0" -c:v libx264 -crf 30 -preset ultrafast -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' -threads 0 ~/Videos/$(date +%F_%A_at_%H:%M:%S).mp4 ``` ___ #### Maybe do something to my face (camera) ``` ffmpeg -hide_banner -loglevel info -thread_queue_size 512 -y -f alsa -i hw:0 -itsoffset -1.266 -thread_queu...

Can't import or play gnome recorded video in Windows System?

`ffmpeg -i in.mp4 -crf 18 -pix_fmt yuv420p -c:a copy out.mp4`

FFmpeg change the color of a video

Change brightness: ffmpeg -i INPUT.MOV -vf eq=brightness=0.5:contrast=2.0:saturation=2.0  -c:a copy OUTPUT.MOV initial brightness (default: 0.0) initial saturation (default: 1.0) initial contrast (default: 1.0) Change to black and white: ffmpeg -i input -vf hue=s=0 -c:a copy output

FFmpeg speed up video

Speed up and smaller: ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4 Speed up and bigger: ffmpeg -i in.mp4 -vf "setpts=0.5*PTS" -r 50 -c:v mpeg4 -b:v 1500k -af "atempo=2" out.mp4 For .bat in folder on Windows: for %%* in (.) do set DirName=%%~nx* mkdir "%DirName%" for %%i IN (*.mp4) DO ffmpeg -i "%%i" -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" "%DirName%/%%i" pause If you want to convert other-format video to .mp4 on Windows: for %%a in ("*.flv") do ffmpeg -i "%%a" -codec copy "%%~na.mp4" for %%a in ("*.flv") do del "%%a" If you want to convert other-format to .mp4 on linux: for file in *.mkv; do sudo ffmpeg -i "$file" -codec copy "${file%.mkv}".mp4; done rm -fr *.mkv ( sudo mkdir d...