Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay while recording video? #27

Open
developerandroid123 opened this issue Jun 23, 2017 · 18 comments
Open

Overlay while recording video? #27

developerandroid123 opened this issue Jun 23, 2017 · 18 comments

Comments

@developerandroid123
Copy link

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

@CrazyOrr
Copy link
Owner

Yes, please refer to #11

@developerandroid123
Copy link
Author

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

@Jagdeep-Sing
Copy link

i also want overlay

@CrazyOrr
Copy link
Owner

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

@Jagdeep-Sing
Copy link

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

@Jagdeep-Sing
Copy link

can anyone please help who successfully completed it?

@Jagdeep-Sing
Copy link

Jagdeep-Sing commented Nov 28, 2017

@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!

@CrazyOrr
Copy link
Owner

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

@Jagdeep-Sing
Copy link

Jagdeep-Sing commented Dec 5, 2017

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
Copy link

Jagdeep-Sing commented Dec 5, 2017

UPDATE
In drawtext documentation of ffmpeg they wrote that :

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

drawtext

@CrazyOrr
Copy link
Owner

CrazyOrr commented Dec 5, 2017

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.

@Jagdeep-Sing
Copy link

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.

@CrazyOrr
Copy link
Owner

CrazyOrr commented Dec 6, 2017

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

@Jagdeep-Sing
Copy link

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
Copy link

Jagdeep-Sing commented Dec 7, 2017

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
Copy link

Jagdeep-Sing commented Dec 7, 2017

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.

@CrazyOrr
Copy link
Owner

CrazyOrr commented Dec 7, 2017

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

@Jagdeep-Sing
Copy link

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

Repository owner deleted a comment from huzhen-v5 Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants