Giter Club home page Giter Club logo

ijkplayerrecorder's Introduction

Hi, I'm baka3k

  • 🌐   View my Medium
  • 💬   Connect with me on LinkedIn
  • 👀 I'm called a Technical Leader, Line Manager, Solution Architect, Software Architect, etc... but I'm really just a Coder who likes to explain things.
  • 💞️ If you're passionate about coding and all things tech, I want to hear from you!
  • 📫 How to reach me : [email protected]

Bak3k's Github Stats

ijkplayerrecorder's People

Contributors

te-hieplq1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ijkplayerrecorder's Issues

PlatformException when I run example code

flutter version: 3.7.0

when I run the example code, get error log as follows:
2023-02-13 19:44:34.936741+0800 Runner[75516:709192] Metal API Validation Enabled 2023-02-13 19:44:35.027603+0800 Runner[75516:709192] GrMtlCommandBuffer: WARNING: Creating MTLCommandBuffer while in background. 2023-02-13 19:44:35.028466+0800 Runner[75516:709192] GrMtlCommandBuffer: WARNING: Creating MTLCommandBuffer while in background. 2023-02-13 19:44:35.287037+0800 Runner[75516:709449] flutter: The Dart VM service is listening on http://127.0.0.1:59608/XkpVyMBdqR8=/ 2023-02-13 19:44:37.011708+0800 Runner[75516:709436] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(unregistered_view_type, A UIKitView widget is trying to create a PlatformView with an unregistered type: < VideoViewPlatform >, If you are the author of the PlatformView, make sure registerViewFactoryis invoked. See: https://docs.flutter.dev/development/platform-integration/platform-views#on-the-platform-side-1 for more details. If you are not the author of the PlatformView, make sure to callGeneratedPluginRegistrant.register., null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18) <asynchronous suspension> #2 PlatformViewsService.initUiKitView (package:flutter/src/services/platform_views.dart:243:5) <asynchronous suspension> #3 _UiKitViewState._createNewUiKitView (package:flutter/src/widgets/platform_view.dart:649:44) <asynchronous suspension>

could anyone met this problem

How to use startRecord method?

Dear author,
I'd like to ask how to use this startRecord for iOS?
Is it ready to use? If it works for now, I really appreciate it coz same method doesn't exist on the original git repo

self.player.startRecord(withFileName: "xxx")

What should I use with this parameter withFileName ?

[iOS] blocking ui when playing a video

Hi!
I'm using your branch for RTSP Streaming, it plays smoothly for live stream. However, there is an issue on my side when playing a mp4 video. It often blocks the UIViewController where IJKFFMoviePlayerController is attached

For example: I cannot touch on any buttons, seekbar, etc on the same UIViewController

FYI: I did the same and it worked with RTSP, the problem is just playing a video such as mp4

var player: IJKFFMoviePlayerController!

func playVideo(url: URL) {
        
    IJKFFMoviePlayerController.setLogLevel(k_IJK_LOG_DEBUG)
    IJKFFMoviePlayerController.setLogReport(true)
    let options = IJKFFOptions.byDefault()
    
    options?.setFormatOptionIntValue(1, forKey: "dns_cache_clear")
    
    options?.setFormatOptionIntValue(1, forKey: "enable-accurate-seek")

    self.player = IJKFFMoviePlayerController(contentURL: url, with: options)
    
    let autoresize = UIView.AutoresizingMask.flexibleWidth.rawValue |
        UIView.AutoresizingMask.flexibleHeight.rawValue
    self.player.view.autoresizingMask = UIView.AutoresizingMask(rawValue: autoresize)
    
    self.player.view.frame = self.videoView.bounds
    self.player.scalingMode = IJKMPMovieScalingMode.aspectFit
    self.player.shouldAutoplay = true
    self.videoView.addSubview(self.player.view)
    self.videoView.sendSubviewToBack(self.player.view)
    self.player.prepareToPlay()

}

Have you ever ran into this issue before? or do you have any idea to solve it?

Error occurred when opening output file

Dear @baka3k ,
I try to make record videos from FFmpeg in the Android app but when sending path file /storage/emulated/0/Android/data/com.example.appflutter/files/Record/9/20210316T215208.mp4
then show error "Error occurred when opening output file"

`int ffp_start_recording_l(FFPlayer *ffp, const char *file_name)
{
av_log(NULL, AV_LOG_INFO, "Nani: ffp_start_recording_l file_name:%s\n", file_name);
assert(ffp);
VideoState *is = ffp->is;

ffp->m_ofmt_ctx = NULL;
ffp->m_ofmt = NULL;
ffp->is_record = 0;
ffp->record_error = 0;

if (!file_name || !strlen(file_name)) {
    av_log(NULL, AV_LOG_ERROR, "Nani: filename is invalid");
    goto end;
}

if (!is || !is->ic || is->paused || is->abort_request) { // no context, or the context has stopped
    av_log(NULL, AV_LOG_ERROR, "Nani: is,is->ic,is->paused is invalid");
    goto end;
}

if (ffp->is_record) {
    av_log(NULL, AV_LOG_ERROR, "Nani: recording has started");
    goto end;
}

/* Initialize libavcodec, and register all codecs and formats. */
av_register_all();

// Initialize an AVFormatContext structure for output
avformat_alloc_output_context2(&ffp->m_ofmt_ctx, NULL, NULL, file_name);
// avformat_alloc_output_context2(&ffp->m_ofmt_ctx,av_guess_format("mp4", NULL, "video/mp4"), NULL, NULL);
if (!ffp->m_ofmt_ctx) {
    av_log(NULL, AV_LOG_ERROR, "Nani: Could not create output context filename is %s\n", file_name);
    goto end;
}
ffp->m_ofmt = ffp->m_ofmt_ctx->oformat;
av_log(NULL, AV_LOG_ERROR, "Nani: is->ic->nb_streams=%d\n", is->ic->nb_streams);
/* Add the audio and video streams using the default format codecs and initialize the codecs. */
for (int i = 0; i < is->ic->nb_streams; i++) {
    // Create an output stream channel against the input stream
    AVStream *in_stream = is->ic->streams[i];
    AVStream *out_stream = avformat_new_stream(ffp->m_ofmt_ctx, in_stream->codec->codec);
    if (!out_stream) {
        av_log(NULL, AV_LOG_ERROR, "Nani: Failed allocating output stream\n");
        goto end;
    }
    // Copy the input video/audio parameters to the AVCodecContext structure of the output video/audio
    av_log(ffp, AV_LOG_DEBUG, "Nani: in_stream->codec;%p\n", in_stream->codec);
    if (avcodec_copy_context(out_stream->codec, in_stream->codec) < 0) {
        av_log(NULL, AV_LOG_ERROR, "Nani: Failed to copy context from input to output stream codec context\n");
        goto end;
    }
    
    out_stream->codec->codec_tag = 0;
    if (ffp->m_ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) {
        out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
    }
}
av_log(NULL, AV_LOG_ERROR, "Nani: Output Information\n");
av_dump_format(ffp->m_ofmt_ctx, 0, file_name, 1);
//Open the output file
if (!(ffp->m_ofmt->flags & AVFMT_NOFILE)) {
    if (avio_open(&ffp->m_ofmt_ctx->pb, file_name, AVIO_FLAG_WRITE) < 0) {
        av_log(NULL, AV_LOG_ERROR, "Nani: Could not open output file '%s'", file_name);
        goto end;
    }
}
//write video file header
if (avformat_write_header(ffp->m_ofmt_ctx, NULL) < 0) {
    av_log(NULL, AV_LOG_ERROR, "Nani: Error occurred when opening output file\n");
    goto end;
}

ffp->is_record = 1;
ffp->record_error = 0;
pthread_mutex_init(&ffp->record_mutex, NULL);

return 0;

end:
ffp->record_error = 1;
return -1;
}
`

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.