pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.52k stars 770 forks source link

OpenGl RTSP record vedio 20s, but only have 17s, loss 3s #1565

Open HoanChen opened 2 weeks ago

HoanChen commented 2 weeks ago

Describe the bug in branch feature/extra-video-source ,OpenGl RTSP record vedio 20s, but only have 17s, loss 3s

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

pedroSG94 commented 2 weeks ago

Hello,

Are you using the listener to know the moment when the video record start? https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/rotation/CameraFragment.kt#L139

HoanChen commented 2 weeks ago

hello mogul

I used class that is OpenGlRtspActivity

---- Replied Message ---- | From | Pedro @.> | | Date | 09/02/2024 00:22 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [pedroSG94/RootEncoder] OpenGl RTSP record vedio 20s, but only have 17s, loss 3s (Issue #1565) |

Hello,

Are you using the listener to know the moment that the video record start? https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/rotation/CameraFragment.kt#L139

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

pedroSG94 commented 1 week ago

I don't understand you. Are you using the listener in startRecord method or not?

HoanChen commented 1 week ago

I used the feature

is it right?

what's your vx?

At 2024-09-02 19:19:53, "Pedro Sánchez" @.***> wrote:

I don't understand you. Are you using the listener in startRecord method or not?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

pedroSG94 commented 1 week ago

I still don't understand you.

You can check the moment the video really start recording but It is not immediately after call startRecord.

The video start when a keyframe is detected so you can check that moment using the listener in startRecord method like this:

        genericStream.startRecord(recordPath) { status ->
          if (status == RecordController.Status.RECORDING) {
            //The video start to record now
          }
        }
HoanChen commented 1 week ago

Hi , big mogul

where do i add the code

genericStream.startRecord(recordPath) { status ->if (status ==RecordController.Status.RECORDING) { //The video start to record now } }

Here?

I have another question: how to add watermark immediately when recording ?

At 2024-09-03 18:32:12, "Pedro Sánchez" @.***> wrote:

I still don't understand you.

You can check the moment the video really start recording. It is not immediately after call startRecord. The video start when a keyframe is detected. You can check that moment using the listener in startRecord method like this:

    genericStream.startRecord(recordPath) { status ->if (status ==RecordController.Status.RECORDING) {
        //The video start to record now
      }
    }

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

pedroSG94 commented 1 week ago

Hello,

First of all. I can't see images if you uploaded it. Maybe because you send the response from the email.

About watermark, you have an example here: https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/utils/FilterMenu.kt#L212