ffmpeg-screen

#更换新显示器时,获取屏幕尺寸 #根据显示器的尺寸截取全屏 ffmpeg -f x11grab -video_size 1360:768 -i :0.0+0,0 -frames:v 1 -f image2 202505031611.jpg -y && #ffplay -window_title monitor -f x11grab -video_size 400:400 -i :0.0+0,0 -vf “drawbox=x=150:y=150:w=200:h=200:color=ff0000:t=3,scale=300×300” -left 760 -top 1 #查看全屏图片需要录制的桌面像素位置 #ffplay -i screen.jpg -vf ‘crop=1340:850:310:200’ #ffmpeg -i screen.jpg -vf ‘crop=1340:850:310:200’ #ffplay -window_title monitor -f x11grab -video_size 800:300 -i :0.0+200,400 -vf scale=300×300 -vf “drawbox=color=black”:t=1.5… Continue reading ffmpeg-screen

Published
Categorized as ffmpeg

ffmpeg-scale

指定长宽: ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png 指定长,高度按比例缩放: ffmpeg -i input.jpg -vf scale=320:-1 output_320x240.png 缩放为之前的两倍: ffmpeg -i input.jpg -vf scale=iw*2:ih input_double_width.png 缩放为之前的二分之一: ffmpeg -i input.jpg -vf scale=iw*.5:ih*.5 input_half_size.png ffmpeg -i input.jpg -vf scale=iw/2:ih/2 input_half_size.png ffmpeg -i test.mp4 -vf scale=width=iw/3:height=ih/3 ff_scale.mp4

Published
Categorized as ffmpeg

ffmpeg-rotate

ffmpeg -f lavfi -i color=#FFFFFF:size=400×150\ -frames:v 1 -vf “drawtext=fontfile=\ /usr/share/fonts/msyh.ttf:fontcolor=ff0000:\ fontsize=45:x=100:y=50:text=’I enjoy you.'”\ -f image2 /home/root135/Documents/I_enjoy_you.jpg -y ffmpeg -i I_enjoy_you.jpg\ -vf “drawtext=fontfile=/usr/share/fonts/msyh.ttf:\ text=’Your Text Here’:fontsize=24:fontcolor=black:\ x=100:y=100,rotate=PI/4” I_enjoy_you_out.jpg -y

Published
Categorized as ffmpeg

ffmpeg-rgba

ffmpeg test.mp4 format=pix_fmts=rgba,colorchannelmixer=rr=0.3:rg=0.4:rb=0.3:gr=0.3:gg=0.4:gb=0.3:br=0.3:bg=0.4:bb=0.3 output_fade.mp4 ffmpeg test.mp4 format=pix_fmts=rgba,colorchannelmixer=rr=0.393:rg=0.796:rb=0.189:gr=0.349:gg=0.686:gb=0.168:br=0.272:bg=0.534:bb=0.131 output_fade.mp4 ffmpeg test.mp4 -vf eq=brightness=0.1:contrast=1.0:gamma=1.0:saturation=1.0 ff_eq.mp4 ffmpeg test.mp4 -vf eq=brightness=-0.1:contrast=1.0:gamma=1.0:saturation=1.0 ff_eq.mp4 ffmpeg test.mp4 -vf vignette=angle=PI/4 output_fade.mp4 ffmpeg test.mp4 -vf vignette=angle=PI/2 output_fade.mp4 ffmpeg test.mp4 -vf fade=type=in:start_time=0:duration=2 output_fade.mp4 ffmpeg test.mp4 -vf fade=type=out:start_frame=TOTAL_FRAMES-25:nb_frames=25 output_fade.mp4 ffmpeg test.mp4 -vf fade=type=out:start_time=START_TIME:duration=2 2 output_fade.mp4

Published
Categorized as ffmpeg

ffmpeg-pactl

pactl list | grep -A2 ‘Source #’ Source #0 State: SUSPENDED Name: alsa_input.usb-SN0002_2K_USB_Camera_46435000_P030300_SN0002-02.multichannel-input — Source #1 State: SUSPENDED Name: alsa_output.pci-0000_00_14.2.analog-stereo.monitor

Published
Categorized as ffmpeg