EzDev.org

ijkplayer

ijkplayer - Android/iOS video player based on FFmpeg n3.3, with MediaCodec, VideoToolbox support.


On updating android stdio,Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException:

Today when i had updated my android stdio , then i had seen following error , i can not understand cause for these error but it is giving a lot of

truble . 
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2

and these is also under previous error ,

Error:Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
AGPBI: {"kind":"simple","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","sources":[{}]}
AGPBI: {"kind":"simple","text":"com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim;","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:188)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.run(Main.java:277)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.main(Main.java:245)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.Main.main(Main.java:106)","sources":[{}]}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

These is my gradle file ,

// Top-level build file where you can add configuration options common to all sub-projects/modules.

task wrapper(type: Wrapper) {
    gradleVersion = '2.2.1' 
}
buildscript {
    repositories {
        jcenter()
         mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
         mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

These is second build.gradle file ,

apply plugin: 'com.android.application'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.shubham.MeraIndore"
        minSdkVersion 12
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.androidanimations:library:1.0.3@aar'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile project(':library')
}

Please help me .


Source: (StackOverflow)

how to open a live stream like"p2p://207.238.82.38:9916/51aea8370002dc6ce83e43c11c6234f6"

I have a android player app which use ijkplayer as core engine.of course the native is supported by ffmepg.Now i want to support p2p protocol(like p2p://207.238.82.38:9916/51aea8370002dc6ce83e43c11c6234f6 ) in my app.Who has a good idea? ths


Source: (StackOverflow)

Android ndk build failed

Though my current ndk version is greater than r10e , but it is saying

build on Linux x86_64
ANDROID_NDK=/root/Android/Sdk/ndk-bundle/
IJK_NDK_REL=15.1.4119039
You need the NDKr10e or later

EDIT

I am trying to build ijkplayer , I am just following the build instruction when I tried to execute the ./compile-ffmpeg.sh all I got this error.


Source: (StackOverflow)

iOS multiple video display

I'm currently doing an iOS project that uses IJKPlayer which is based on FFmpeg and SDL to display RTSP feed from a certain source.

I have no problem in displaying a single video feed but my project requires me to display multiple stream on the screen simultaneously, the problem I'm facing right now is to separate each of the streams and display it on n number of instances of player.

RTSP -> stream 0, stream 1, stream 2, stream 4 -> display

Here is a sample output I want to achieve. Each color represents a single stream. Thanks!

enter image description here

Edit: If this is not possible on IJKPlayer, can someone recommend a different approach on how to implement this?


Source: (StackOverflow)

Error when creating Archive

i m implementing rtmp streaming player and its work fine on device, but when i create archive of project, error occurred,

I am using this framwork: IJKMediaFramework and its working good, but not able to create Archive

enter image description here


Source: (StackOverflow)

Android lib ijkplayer load https url

I am using ijkplayer in my android app that I compile using

compile 'tv.danmaku.ijk.media:ijkplayer-java:0.4.5'
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.4.5'

It works perfectly loading http urls but if I try to load https urls I get this error

https protocol not found, recompile FFmpeg with openssl, gnutls, or securetransport enabled.

and can't load my video. I don't know if it makes any difference but the url I am trying to load is a .m3u8 but if it is http works fine.

How can I recompile ffmpeg in this lib?


Source: (StackOverflow)

Android layout collapse

I use a XWalkView to load webpage and a IjkVideoView to play live video in my app. I want the IjkVideoView playing the video in front the XwalkView, so I put these two view in a relativelayout and IijVideoView behind the XWalkView.

In the android studio's Component Tree of Design window the layout seems ok as below image,

enter image description here

While when I run the app in my device, the layout is in mess as below image. You can see the background of IjkVieoView is in front of XWalkView, but the video playing in the IjkVideoView is behind the XWalkView, as the upper part of the video has been covered by the XWalkView.

enter image description here

layout xml,

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:ignore="UselessParent">

        <!-- This could be your fragment container, or something -->

        <org.xwalk.core.XWalkView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/xWalkView"
            android:layout_width="fill_parent"
            android:layout_height="160dp"
            android:background="@color/blue"
            android:isScrollContainer="true">

        </org.xwalk.core.XWalkView>

        <com.xxxxxx.app.widget.media.IjkVideoView
            android:id="@+id/video_view"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="72dp"
            android:background="@color/colorAccent" />

        <com.roughike.bottombar.BottomBar
            android:id="@+id/bottomBar"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_alignParentBottom="true"
            app:bb_tabXmlResource="@xml/web_tabs" />

    </RelativeLayout>
</LinearLayout>

activity java code,

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("INFO", "entered");
        setContentView(R.layout.activity_web);
        mXWalkView = (XWalkView) findViewById(R.id.xWalkView);
        XWalkSettings webSettings = mXWalkView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mXWalkView.addJavascriptInterface(new JsInterface(), "NativeInterface");

        videoView = (IjkVideoView) findViewById(R.id.video_view);
        videoView.setAspectRatio(IRenderView.AR_ASPECT_FILL_PARENT);
        videoView.setVideoURI(Uri.parse("http://live.xxxxxx.com/live/40xx27.flv"));
        videoView.start();

        final Bundle extras = getIntent().getExtras();
        mXWalkView.load("http://xxxxxxxxxxxxxx", null);
}

Source: (StackOverflow)

deinterlace video when playing with IJKPlayer

There are exact four entries when searching google about deinterlaced play back with IJKPlayer. The best one seems to be this. However, the mentioned solution by adding

mediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "vf0", "yadif")

to the code doesn't seem to work. Of course, when using ffplay (or ffmpeg) it's all about filters beeing included or not. So, is there any working solution available, which deinterlaces with IJKPlayer and tells which filters to use (during compiletime and runtime), idiot-proof?

EDIT:

I found, that the player has been compiled with --disable-avfilter. I checked out the latest version from git and compiled it with --enable-avfilter. Now, directory android/contrib/build/ffmpeg-armv7a/output/lib contains libavfilter.a, also. libijkffmpeg.so is bigger in size and running

nm -D --defined-only libijkffmpeg.so

shows the symbol vf_yadif. However, IJKPlayer still doesn't deinterlace when using with option vf0/yadif.

I added version info for avfilter, too:

I/IJKMEDIA: ===== versions =====
I/IJKMEDIA: ijkplayer    : k0.8.0
I/IJKMEDIA: FFmpeg       : ff3.3--ijk0.8.0--20170518--001
I/IJKMEDIA: libavutil    : 55.58.100
I/IJKMEDIA: SDL_RunThread: [32440] ff_msg_loop
I/IJKMEDIA: libavcodec   : 57.89.100
I/IJKMEDIA: libavformat  : 57.71.100
I/IJKMEDIA: libavfilter  : 6.82.100
I/IJKMEDIA: libswscale   : 4.6.100
I/IJKMEDIA: libswresample: 2.7.100

Source: (StackOverflow)

How to make player resume from the newest frame?

I use ijkplayer to play the live video in my ios app.

Here is the code for player initialization

    let options = IJKFFOptions.byDefault()
    let streamUrl:String = "http://xxxxxxxxx.com/test/7777.flv"
    let player = IJKFFMoviePlayerController(contentURLString: streamUrl, with: options)
    let autoresize = UIViewAutoresizing.flexibleWidth.rawValue | UIViewAutoresizing.flexibleHeight.rawValue
    player?.view.autoresizingMask = UIViewAutoresizing(rawValue: autoresize)
    player?.view.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
    let gesture = UITapGestureRecognizer(target: self, action: #selector(self.compressExpand(_:)))
    player?.view.addGestureRecognizer(gesture)
    player?.view.backgroundColor = UIColor.black
    player?.scalingMode = .aspectFit
    player?.shouldAutoplay = false
    self.player = player
    self.player.shouldShowHudView = true
    self.player.setPlayerOptionIntValue(1000, forKey: "max_cached_duration")

The issue is I use player.pause() to resume the player for some time. Then I use player.play() to resume playing. Live video then playing from the frame where paused, what I want is to resume the video from the latest or newest frame.


Source: (StackOverflow)

cannot fill the screen even when I set fill_parent in ijkplayer

we have a Live show module to do recently.

I have a question about the setAspectRatio(IRenderView.AR_ASPECT_FILL_PARENT) ,it is useless in my project.

we use the PLDroidMediaStreaming sdk to publish the live and get the playURL, At first, we want to integrate the PLDroidPlayer to play the rtmp, but our project had already integrated the ijkplayer before, there is always have a unsolvable FC conflict, so we use the ijkplayer at last.

But there is alway have a bug when playing the rtmp, there always have 10dp gap in both two sides, no matter set the type is fill_parent or fit_parent.

To test the rtmp is normally, we play the rtmp url in PLDroidPlayer , the frame is normally fill the screen.

so could you help me about the issues? thanks advance


Source: (StackOverflow)

How to avoid audio pts start from zero after reconfigure the atempo?

I found the pts of audio is always start from zero if i reconfigure the atempo filter in ijkplayer which based on ffplay.

The code snippet is from ijkplayer

#ifdef FFP_AVFILTER_PLAYBACK_RATE
    if (fabsf(ffp->pf_playback_rate) > 0.00001 &&
        fabsf(ffp->pf_playback_rate - 1.0f) > 0.00001) {
        if (afilters_args[0])
            av_strlcatf(afilters_args, sizeof(afilters_args), ",");

        av_log(ffp, AV_LOG_INFO, "af_rate=%f\n", ffp->pf_playback_rate);
        av_strlcatf(afilters_args, sizeof(afilters_args), "atempo=%f", ffp->pf_playback_rate);
    }
#endif

    if ((ret = configure_filtergraph(is->agraph, afilters_args[0] ? afilters_args : NULL, filt_asrc, filt_asink)) < 0)
        goto end;

    is->in_audio_filter  = filt_asrc;
    is->out_audio_filter = filt_asink;

How to avoid audio pts start from zero after reconfigure the atempo filter ?


Source: (StackOverflow)

How to integrate IjkPlayer with my own project Android Studio

I would need some help with IJKPlayer on Android Studio. I have been trying for several days and still can not figure out how to play desired url in IjkPlayer.

Basically i have compiled successfully IjkPlayer with OpenSSL support. I am able to just Open project to Android Studio. And i have tried to run IjkPlayer-Example. So i have made sure it does work before going any further.

I have copied manually folder MyApp to root of IjkPlayer folder. And modified settings.gradle by adding my project to include:

include ':ijkplayer-armv5', ':ijkplayer-x86_64'
include ':ijkplayer-armv7a'
include ':ijkplayer-arm64'
include ':ijkplayer-x86'
include ':ijkplayer-java'
include ':ijkplayer-exo'
include ':ijkplayer-example'
include ':myapp'

I am able to run my app from this whole project and it does compile and run IjkExample and MyApp without errors.

As a separate Applications.

To integrate i did tried to import the whole example project along with player:

for example: (FILE from MyApp module: VideoPlayerActivity.java)

package xyz.myplayer;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import tv.danmaku.ijk.media.player.misc.ITrackInfo;
import tv.danmaku.ijk.media.example.*;

and i have added in build.gradle (of myapp module):

compile project(':ijkplayer-example')
compile project(':ijkplayer-java')
compile project(':ijkplayer-exo')
compile project(':ijkplayer-armv5')
compile project(':ijkplayer-armv7a')

I have tried to create new intent from my activity passing arguments videoPath and videoTitle to VideoActivity.java what is inside of ijkplayer-example (tv.danmaku.ijk.media.example.activities.VideoActivity.class)

android.util.Log.d("LOGS", "Trying to fireup IJKVideoView");
Intent i = new Intent(getApplicationContext(), VideoActivityPlayer.class);
i.putExtra("videoPath", PlayURLstring);
android.util.Log.d("LOGS", "VIDEO_PATH TO: "+PlayURLstring);
i.putExtra("videoTitle", PlaylistIDstring);
android.util.Log.d("LOGS", "VIDEO_TITLE TO: "+PlaylistIDstring);
startActivity(i);

but it would not work it said VideoActivity can not be found but its there... Or just i can not do it this way?

To be very honest i have no idea how can i play my url inside of ijkplayer - example itself its very complicated for me all of it its joined together...

That is why I need an advice or at least what else i can try to integrate ijkplayer with my app and to pass url and title to ijkplayer.


Source: (StackOverflow)