Code Monkey home page Code Monkey logo

rtsprecorder's Introduction

IJKPlayer Sample

In previous time, I added 2 functions: RecordVideo & Capture Frame Video to IJKPlayer (https://github.com/baka3k/IjkPlayerRecorder)

Someone sent email to me that they can not build .so file, because they met issue with environment

So, I created sample project(included .so file) - Hope this help

Good luck !!!

Table of contents

Features

  • RTSP Player By IJKPlayer
  • Support Get Frame Video
  • Support Record Video
  • Support Add Filter Video
  • Record Video withFilter: Not at this time

Requirements

  • Android 5.1+

Gradle

build.gradle:

allprojects {
    repositories {
        .....
        maven { url 'https://jitpack.io' } // add this line to build.gradle
    }
}

Add the dependency

dependencies {
    implementation "com.github.baka3k:RTSPRecorder:1.0.1"
}

Usage

Capture Video Frame

Bitmap bitmap = mVideoView.getCurrentFrame();

RecordVideo

mVideoView.startRecord(mOutPutRecord);
//then MUST call stop Record
mVideoView.stopRecord();

Add Filter to video: (Many thanks to MasayukiSuda https://github.com/MasayukiSuda/GPUVideo-android)

GlHazeFilter hazeFilter = new GlHazeFilter();
hazeFilter.setSlope(-0.8f);
contentView.setFilter(hazeFilter);

Sample

Output sample

refer sample in below package

com.hi.sample.videoplayer.sample.VideoActivity
com.hi.sample.videoplayer.sample.VideoFilterActivity

Authors

[email protected]

License

Apache licensed Copyright <2021> [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

rtsprecorder's People

Contributors

baka3k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rtsprecorder's Issues

record fail

Recording failed, file size 0kb,also No error log,why?

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0

public void buttonCaptureOnClicked(View view) {
        new AsyncTask<Void, Void, Boolean>() {
            @Override
            protected Boolean doInBackground(Void... voids) {
                Bitmap bitmap = Bitmap.createBitmap(1280, 720, Bitmap.Config.ARGB_8888);
                boolean result = false;
                mVideoView.getCurrentFrame(bitmap);

                if (bitmap != null) {
                    File f = new File(mOutPutCaptureFrame);
                    if (f.exists()) {
                        f.delete();
                    }
                    result = BitmapUtils.saveBitmap(bitmap, mOutPutCaptureFrame);
                } else {
                    Log.w("VideoActivity", "bitmap null");
                }
                return result;
            }

            @Override
            protected void onPostExecute(Boolean aVoid) {
                super.onPostExecute(aVoid);
                if (aVoid) {
                    Toast.makeText(getApplicationContext(), "file save to " + mOutPutCaptureFrame, Toast.LENGTH_SHORT).show();
                } else {
                    Toast.makeText(getApplicationContext(), "err, can not save frame" + mOutPutCaptureFrame, Toast.LENGTH_SHORT).show();
                }

            }
        }.execute();
    }

mVideoView.getCurrentFrame(bitmap);
following crash:

2021-05-20 16:38:26.600 6300-6300/com.hi.recorderijkplayersample A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6300 (ijkplayersample)
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: Build fingerprint: 'Android/rk3399_all/rk3399_all:7.1.2/NHG47K/yu09012103:userdebug/test-keys'
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: Revision: '0'
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: ABI: 'arm64'
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: pid: 6300, tid: 6300, name: ijkplayersample  >>> com.hi.recorderijkplayersample <<<
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x0   00000000787fc00c  x1   0000000000000000  x2   0000000000002780  x3   0000000000000003
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x4   0000000000000000  x5   0000000000000000  x6   00000000787fc00c  x7   0000000000eda3e6
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x8   0000000000000000  x9   000000000000002b  x10  0000007fd0da18a0  x11  0000000000000021
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x12  0000000000000018  x13  0000000060a62002  x14  0023949499e637f4  x15  00002920289ac0dd
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x16  000000761fe99660  x17  0000007649092908  x18  0000000000000000  x19  0000000000000000
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x20  00000000787fe80c  x21  0000000000000001  x22  0000000000002800  x23  00000000000005a0
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x24  0000000000000000  x25  000000761fe75000  x26  0000007647495a98  x27  9bcb2fdeb7c5fbfa
2021-05-20 16:38:26.645 6399-6399/? A/DEBUG:     x28  0000000000000002  x29  0000007fd0da1f98  x30  000000761fe484f0
2021-05-20 16:38:26.646 6399-6399/? A/DEBUG:     sp   0000007fd0da1e10  pc   0000007649092a40  pstate 0000000020000000
2021-05-20 16:38:26.648 6399-6399/? A/DEBUG: backtrace:
2021-05-20 16:38:26.648 6399-6399/? A/DEBUG:     #00 pc 000000000001aa40  /system/lib64/libc.so (memcpy+312)
2021-05-20 16:38:26.648 6399-6399/? A/DEBUG:     #01 pc 000000000001b4ec  /data/app/com.hi.recorderijkplayersample-1/lib/arm64/libijkplayer.so (ffp_get_current_frame_l+192)
2021-05-20 16:38:26.648 6399-6399/? A/DEBUG:     #02 pc 0000000000029cc8  /data/app/com.hi.recorderijkplayersample-1/lib/arm64/libijkplayer.so
2021-05-20 16:38:26.648 6399-6399/? A/DEBUG:     #03 pc 000000000061e6ec  /data/app/com.hi.recorderijkplayersample-1/oat/arm64/base.odex (offset 0x587000)

Record Video withFilter is on plan?

Your lib is pretty awesome. I want to add a filter to my recorded video.
Is recording video with filter on your dev plan?
or how can I do it to add a filter to my recorded video?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.