FFmpegRecorder icon indicating copy to clipboard operation
FFmpegRecorder copied to clipboard

Overlay while recording video?

Open developerandroid123 opened this issue 8 years ago • 18 comments

Can we add overlay like text,image or video while recording ?

developerandroid123 avatar Jun 23 '17 10:06 developerandroid123

Yes, please refer to #11

CrazyOrr avatar Jun 23 '17 11:06 CrazyOrr

I am not able to get any hint about overlay from #11

developerandroid123 avatar Jun 23 '17 11:06 developerandroid123

i also want overlay

Jagdeep-Sing avatar Nov 25 '17 10:11 Jagdeep-Sing

You should search for FFmpeg feature for your need, like overlay.

CrazyOrr avatar Nov 27 '17 01:11 CrazyOrr

i read that documentation and code, now where should is i place it? in resumeRecording() function? im not getting it

Jagdeep-Sing avatar Nov 28 '17 07:11 Jagdeep-Sing

can anyone please help who successfully completed it?

Jagdeep-Sing avatar Nov 28 '17 09:11 Jagdeep-Sing

@CrazyOrr, needs your help
How do i implement following code in this project:

drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"

this is drawtext property of ffmpeg, how do i implement this?

after searching i found THIS. but i dont know where to add this command in this project so that text will be added to video.

Thanks!

Jagdeep-Sing avatar Nov 28 '17 11:11 Jagdeep-Sing

Check out FFmpegFrameFilter used in VideoRecordThread, there are 'transpose' and 'crop' filters used in this project already as examples for you.

CrazyOrr avatar Nov 29 '17 01:11 CrazyOrr

Thanks for your response!! I see in code, you apply filter like this :

List<String> filters = new ArrayList<>(); String transpose = null;

transpose = "transpose=cclock"; //cclock is a filter //then you add filter like this filters.add(transpose);

FFmpegFrameFilter frameFilter = new FFmpegFrameFilter(TextUtils.join(",", filters),previewWidth, previewHeight);

**Can I do same also for adding text? like :**

List<String> filters = new ArrayList<>(); String drawtext = null;

drawtext = "drawtext=fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"; //then apply text like this filters.add(drawtext);

FFmpegFrameFilter frameFilter = new FFmpegFrameFilter(TextUtils.join(",", filters),previewWidth, previewHeight);

**am I right? please help...**

Jagdeep-Sing avatar Dec 05 '17 05:12 Jagdeep-Sing

UPDATE In drawtext documentation of ffmpeg they wrote that :

To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype.

drawtext

Jagdeep-Sing avatar Dec 05 '17 07:12 Jagdeep-Sing

Yes, according to this, --enable-libfreetype has already been configured for building this FFmpeg library. If not so, try again with the latest version of JavaCV or build it by yourself.

CrazyOrr avatar Dec 05 '17 12:12 CrazyOrr

okay thanks, can you then please help where i place this code, i tried with code that i posted here but it results in force close.

Jagdeep-Sing avatar Dec 05 '17 13:12 Jagdeep-Sing

It crashes with Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 24319 now. Refer to this issue of JavaCV.

CrazyOrr avatar Dec 06 '17 02:12 CrazyOrr

Same error for me and I didn't find any solution there. that issue is for building JavaCV with libfreetype but this project is already configured for that, its a confusion now

Jagdeep-Sing avatar Dec 06 '17 09:12 Jagdeep-Sing

got same error when use : overlay error:

android A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 320 (Thread-24542)

Jagdeep-Sing avatar Dec 07 '17 07:12 Jagdeep-Sing

UPDATE: I tried it with latest version of JAVACV by changing the version in dependencies and got the same error. maybe I'm doing some syntax error I think.

Jagdeep-Sing avatar Dec 07 '17 11:12 Jagdeep-Sing

You can try the commands out by using FFmpeg on your computer.

CrazyOrr avatar Dec 07 '17 15:12 CrazyOrr

yes in command line its working fine, I tested in Ubuntu

Jagdeep-Sing avatar Dec 08 '17 10:12 Jagdeep-Sing