현재 ffmpeg 명령을 사용하여 여러 비디오를 변환하고 재생 시간 120 초마다 오른쪽에서 왼쪽으로 오른쪽으로 이동하는 스크롤 텍스트 인 워터 마크를 만듭니다.
find /home/video/ -type f -execdir ffmpeg -i '{}' -filter:v "drawtext=fontfile=/root/FreeSans.ttf:text='QWERTY':[email protected]:fontsize=26:y=h-line_h-30:x=w/20*mod(t\,120),scale=854:480" -pix_fmt yuv420p -c:v libx264 -preset slow -b:v 1000k -minrate 500k -maxrate 2000k -bufsize 2000k -c:a aac -ar 44100 -b:a 128k -movflags +faststart '/home/video/new/{}.mp4' \;
워터 마크를 다음과 같이 수정하고 싶습니다
위에 표시된 텍스트가 120 초마다 사라지고 15 초 동안 지속되기를 원합니다. 굵은 형식과 같은 색상 (검정색)이어야합니다.
"qwerty qwerty qwerty qwerty" 새로운 라인
"qwerty qwerty qwerty qwerty"
현재 사용중인 명령과 관련된 또 다른 문제는 다른 비디오 프레임과 관련된 것입니다. 예를 들어 동영상이 800x600에 불과하면 텍스트가 매우 커집니다. 비디오가 1920x1080이면 텍스트가 매우 작습니다. 프레임 속도에 따라 텍스트 크기를 조정하고 싶습니다. 화면 크기 측면에서 위와 같이 보일 것입니다.
한 가지 방법은 자막 필터 와 함께 ASS 자막을 사용하는 것입니다 .
ffmpeg -i input -filter_complex "subtitles=fade.ass" -c:a copy output
장점 :
ffmpeg
명령은 간단합니다.불리:
샘플 ASS 파일 (Aegisub 3.2.2에서 생성됨) :
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
[Aegisub Project Garbage]
Last Style Storage: Default
Video Position: 749
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,20,&H00000000,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:15.00,Default,,0,0,0,,{\fad(500,500)}qwerty qwerty qwerty qwerty\Nqwerty qwerty qwerty qwerty
Dialogue: 0,0:02:00.00,0:02:15.00,Default,,0,0,0,,{\fad(500,500)}qwerty qwerty qwerty qwerty\Nqwerty qwerty qwerty qwerty
Dialogue: 0,0:04:00.00,0:04:15.00,Default,,0,0,0,,{\fad(500,500)}qwerty qwerty qwerty qwerty\Nqwerty qwerty qwerty qwerty
Dialogue: 0,0:06:00.00,0:06:15.00,Default,,0,0,0,,{\fad(500,500)}qwerty qwerty qwerty qwerty\Nqwerty qwerty qwerty qwerty
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다