简体   繁体   English

在Android中如何使用ffmpeg在已录制的视频上添加文本作为水印?

[英]In Android how to add text as watermark on already recorded video with ffmpeg?

I am trying to set text as a watermark on already recorded video but it is not working. 我试图在已录制的视频上将文本设置为水印,但无法正常工作。 As I tried image.png as a water mark and it works by following this url http://androidwarzone.blogspot.in/2011/12/ffmpeg4android.html 当我尝试使用image.png作为水印时,它通过遵循以下网址进行工作:http://androidwarzone.blogspot.in/2011/12/ffmpeg4android.html

Command for apply image as watermark on already recorded video: 将图像作为水印应用于已录制视频的命令:

String[] complexCommand = {"ffmpeg","-y" ,"-i", videoPathHere,"-strict",
"experimental", "-vf", "movie=" 
+ Environment.getExternalStorageDirectory().getAbsolutePath() 
+ "/watermarkImg.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]",
"-s", "160x120","-r", "30", "-b", "15496k", "-vcodec", "mpeg4","-ab", "48000", 
"-ac", "2", "-ar", "22050", 
Environment.getExternalStorageDirectory().getAbsolutePath()+"/watermark.mp4"}; 

but when I tried to implement text as watermark its not working: 但是当我尝试将文本实现为水印时,它不起作用:

String[] complexCommand = {"ffmpeg", "-y" , "-i", videoPathHere, "-strict", "experimental", 
"-vf", "drawtext=fontfile=" + file + ":text=TestText", "-s", "160x120", "-r", "30", 
"-b", "15496k", "-vcodec", "mpeg4", "-ab", "48000", "-ac", "2", "-ar", "22050", 
Environment.getExternalStorageDirectory().getAbsolutePath()+"/watermark.mp4"}; 

Even I tried this also https://video.stackexchange.com/questions/15551/ffmpeg-drawtext-filter-create-transparent-background-with-text 甚至我也尝试过这个https://video.stackexchange.com/questions/15551/ffmpeg-drawtext-filter-create-transparent-background-with-text

but it is also not working in my case. 但对于我来说,它也不起作用。

So, what is going wrong with adding text as watermark? 那么,将文本添加为​​水印怎么了?

I make changes in commenad from ;text=TestText to :text=TestText then it shows given error. 我在命令中从; text = TestText更改为:text = TestText,然后显示给定的错误。

07-23 10:58:07.595: I/Videokit(28832): libvideokit.so loaded 07-23 10:58:07.595: I/Videokit(28832): args is not NULL 07-23 10:58:07.595: I/Videokit(28832): more then one arg 07-23 10:58:07.595: I/Videokit(28832): function symbol found 07-23 10:58:07.595: D/Videokit(28832): Calling videokit run via loader 07-23 10:58:07.595: I/Videokit(28832): vk ffmpeg sdcardPath: /data/user/0/valamovie.com/files/ 07-23 10:58:07.595: D/Videokit(28832): call licenseCheckComplex 07-23 10:58:07.595: I/Videokit(28832): licenseCheck in path: /data/user/0/valamovie.com/files/ 07-23 10:58:07.595: I/Videokit(28832): isLicExistsComplex... 07-23 10:58:07.595: I/Videokit(28832): trying to open /data/user/0/valamovie.com/files//ffmpeglicense.lic 07-23 10:58:07.595: I/Videokit(28832): license file found... 07-23 10:58:07.596: I/Videokit(28832): You used 0 of your 15 trial days. 07-23 10:58:07.595:I / Videokit(28832):libvideokit.so已加载07-23 10:58:07.595:I / Videokit(28832):args不是NULL 07-23 10:58:07.595:I / Videokit(28832):多于一个参数07-23 10:58:07.595:I / Videokit(28832):找到功能符号07-23 10:58:07.595:D / Videokit(28832):调用通过加载程序运行的videokit 07-23 10:58:07.595:I / Videokit(28832):vk ffmpeg sdcardPath:/data/user/0/valamovie.com/files/ 07-23 10:58:07.595:D / Videokit(28832):call licenseCheckComplex 07-23 10:58:07.595:I / Videokit(28832):licenseCheck路径:/data/user/0/valamovie.com/files/ 07-23 10:58:07.595:I / Videokit(28832): isLicExistsComplex ... 07-23 10:58:07.595:I / Videokit(28832):尝试打开/data/user/0/valamovie.com/files//ffmpeglicense.lic 07-23 10:58:07.595:I / Videokit(28832):找到许可证文件... 07-23 10:58:07.596:I / Videokit(28832):您使用了15天的试用期中的0天。 07-23 10:58:07.596: D/Videokit(28832): license check rc: 0 07-23 10:58:07.596: D/Videokit(28832): run() called 07-23 10:58:07.670: A/libc(28832): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 28832 (valamovie.com) 07-23 10:58:07.771: A/DEBUG(152): * 07-23 10:58:07.596:D / Videokit(28832):许可证检查rc:0 07-23 10:58:07.596:D / Videokit(28832):run()称为07-23 10:58:07.670: A / libc(28832):致命信号11(SIGSEGV),代码1,tid 28832中的故障加法器0x10(valamovie.com)07-23 10:58:07.771:A / DEBUG(152): * * 07-23 10:58:07.771: A/DEBUG(152): Build fingerprint: 'Lava/PixelV1/PixelV1_sprout:6.0/MRA58V/eng.admin.20160419.120644:user/release-keys' 07-23 10:58:07.771: A/DEBUG(152): Revision: '0' 07-23 10:58:07.771: A/DEBUG(152): ABI: 'arm' 07-23 10:58:07.771: A/DEBUG(152): pid: 28832, tid: 28832, name: valamovie.com >>> valamovie.com <<< 07-23 10:58:07.772: A/DEBUG(152): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10 07-23 10:58:07.789: A/DEBUG(152): r0 00000000 r1 00000001 r2 0000001e r3 00000000 07-23 10:58:07.789: A/DEBUG(152): r4 b8ae87c0 r5 b8ae7fb0 r6 00000000 r7 b8b22500 07-23 10:58:07.789: A/DEBUG(152): r8 9ee64cc4 r9 b8a1fad0 sl b8b625d0 fp 00000000 07-23 10:58:07.789: A/DEBUG(152): ip b6d875dc sp bea3e340 lr 9e3969ac pc 9e395bb8 cpsr 600f0010 07-23 10:58:07.791: A/DEBUG(152): backtrace: 07-23 10:58:07.791: A/DEBUG(152): #00 pc 0007cbb8 /data/app/valamovie.com-1/lib/arm/libvideokit.so 07-23 10:58:08.503: W/ActivityManager(557): Force finishing activity valamovie.com/.Ui.a * 07-23 10:58:07.771:A / DEBUG(152):构建指纹:'Lava / PixelV1 / PixelV1_sprout:6.0 / MRA58V / eng.admin.20160419.120644:user / release-keys'07-23 10:58: 07.771:A / DEBUG(152):修订:'0'07-23 10:58:07.771:A / DEBUG(152):ABI:'arm'07-23 10:58:07.771:A / DEBUG(152) :pid:28832,tid:28832,名称:valamovie.com >>> valamovie.com <<< 07-23 10:58:07.772:A / DEBUG(152):信号11(SIGSEGV),代码1(SEGV_MAPERR) ,Fault addr 0x10 07-23 10:58:07.789:A / DEBUG(152):r0 00000000 r1 00000001 r2 0000001e r3 00000000 07-23 10:58:07.789:A / DEBUG(152):r4 b8ae87c0 r5 b8ae7fb0 r6 00000000 r7 b8b22500 07-23 10:58:07.789:A / DEBUG(152):r8 9ee64cc4 r9 b8a1fad0 sl b8b625d0 fp 00000000 07-23 10:58:07.789:A / DEBUG(152):ip b6d875dc sp bea3e340 lr 9e3969ac pc 9e395 cpsr 600f0010 07-23 10:58:07.791:A / DEBUG(152):回溯:07-23 10:58:07.791:A / DEBUG(152):#00 pc 0007cbb8 /data/app/valamovie.com-1 /lib/arm/libvideokit.so 07-23 10:58:08.503:W / ActivityManager(557):强制完成活动valamovie.com/.Ui.a ddNewProject 07-23 10:58:08.504: A/DEBUG(152): Tombstone written to: /data/tombstones/tombstone_00 07-23 10:58:08.504: E/DEBUG(152): AM write failed: Broken pipe 07-23 10:58:08.505: I/BootReceiver(557): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE) 07-23 10:58:08.527: W/InputDispatcher(557): channel '86e38ae valamovie.com/valamovie.com.Ui.MainActivity (server)' ~ Consumer closed input channel or an error occurred. ddNewProject 07-23 10:58:08.504:A / DEBUG(152):逻辑删除写入:/ data / tombstones / tombstone_00 07-23 10:58:08.504:E / DEBUG(152):AM写入失败:管道损坏07 -23 10:58:08.505:I / BootReceiver(557):将/ data / tombstones / tombstone_00复制到DropBox(SYSTEM_TOMBSTONE)07-23 10:58:08.527:W / InputDispatcher(557):通道'86e38ae valamovie.com/ valamovie.com.Ui.MainActivity(服务器)'〜使用者关闭输入通道或发生错误。 events=0x9 07-23 10:58:08.528: E/InputDispatcher(557): channel '86e38ae valamovie.com/valamovie.com.Ui.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! events = 0x9 07-23 10:58:08.528:E / InputDispatcher(557):通道'86e38ae valamovie.com/valamovie.com.Ui.MainActivity(server)'〜通道已损坏且无法恢复! 07-23 10:58:08.529: W/InputDispatcher(557): channel 'e50713f valamovie.com/valamovie.com.Ui.addNewProject (server)' ~ Consumer closed input channel or an error occurred. 07-23 10:58:08.529:W / InputDispatcher(557):通道'e50713f valamovie.com/valamovie.com.Ui.addNewProject(服务器)'〜使用者关闭了输入通道或发生了错误。 events=0x9 07-23 10:58:08.529: E/InputDispatcher(557): channel 'e50713f valamovie.com/valamovie.com.Ui.addNewProject (server)' ~ Channel is unrecoverably broken and will be disposed! events = 0x9 07-23 10:58:08.529:E / InputDispatcher(557):通道'e50713f valamovie.com/valamovie.com.Ui.addNewProject(server)'〜通道已损坏且无法恢复! 07-23 10:58:08.531: W/ActivityManager(557): Exception thrown during pause 07-23 10:58:08.531:W / ActivityManager(557):暂停期间引发异常

这- ";text=TestText"应该是":text=TestText"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM