英文:
how can i rotate text on video only without the video with ffmpeg commands
问题
我想要只旋转视频上的文本
这是我的代码
-i '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/tmp/.video/1687332725.289482_IMG_0136.MOV' -filter_complex 'crop=1181.25:2100.0:1089.375:0.0, drawtext=
text=Abdullah Muhammad
:fontsize=30
:x=300
:y=600
:box=1
:boxborderw=20
:boxcolor=Gold
' -preset ultrafast -y '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/Library/Caches/1687332725.289482_IMG_0136_1689171861232.mp4';
我尝试过的是
-i '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/tmp/.video/1687332725.289482_IMG_0136.MOV' -filter_complex 'crop=1181.25:2100.0:1089.375:0.0, drawtext=
text=Abdullah Muhammad
:fontsize=30
:x=300
:y=600
:box=1
:boxborderw=20
:boxcolor=Gold
,rotate=PI/6
' -preset ultrafast -y '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/Library/Caches/1687332725.289482_IMG_0136_1689171861232.mp4';
期望结果
> 仅旋转文本
实际结果
> 文本和视频都被旋转
英文:
I want to rotate the text only on the video
here is my code
-i '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/tmp/.video/1687332725.289482_IMG_0136.MOV' -filter_complex 'crop=1181.25:2100.0:1089.375:0.0, drawtext=
text=Abdullah Muhammad
:fontsize=30
:x=300
:y=600
:box=1
:boxborderw=20
:boxcolor=Gold
' -preset ultrafast -y '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/Library/Caches/1687332725.289482_IMG_0136_1689171861232.mp4'
what i have tried
-i '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/tmp/.video/1687332725.289482_IMG_0136.MOV' -filter_complex 'crop=1181.25:2100.0:1089.375:0.0, drawtext=
text=Abdullah Muhammad
:fontsize=30
:x=300
:y=600
:box=1
:boxborderw=20
:boxcolor=Gold
,rotate=PI/6
' -preset ultrafast -y '/Users/me-mac/Library/Developer/CoreSimulator/Devices/F4189FE6-50EA-40B4-AE0F-F19074EE1488/data/Containers/Data/Application/7C214A2B-440B-468F-85F4-AE74CC4EC509/Library/Caches/1687332725.289482_IMG_0136_1689171861232.mp4'
expected result
> Text only to be rotated
actual result
> Text and video are rotated
答案1
得分: 1
ffmpeg -i "input.mp4" -filter_complex "
[0]crop=1000:700:0:0[v];
color=black[c];
[c][v]scale2ref[t][v];
[t]setsar=1,
colorkey=black,
drawtext=text='测试文字':fontsize=30:fontcolor=white:x=300:y=600,
rotate=PI/6:c=black@0[t];
[v][t]overlay=shortest=1
" output.mp4
英文:
draw text on blank video, rotate, then overlay:
ffmpeg -i "input.mp4" -filter_complex "
[0]crop=1000:700:0:0[v];
color=black[c];
[c][v]scale2ref[t][v];
[t]setsar=1,
colorkey=black,
drawtext=text='Test Text':fontsize=30:fontcolor=white:x=300:y=600,
rotate=PI/6:c=black@0[t];
[v][t]overlay=shortest=1
" output.mp4
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论