Location>code7788 >text

FFmpeg development notes (fifty-three) mobile domestic live recording tool EasyPusher

Popularity:24 ℃/2024-09-21 11:40:24
EasyPusher is a domestic RTSP live recording push streaming client tool, it supports Windows, Linux, Android, iOS and other operating systems.EasyPusher adopts RTSP push streaming protocol, of which the Android version of EasyPusher Github hosting address is /EasyDarwin/ EasyPusher-Android.

However, EasyPusher hasn't been updated for several years, and the Android version in particular is still calling the outdated support support libraries instead of the AndroidX libraries that have been introduced for years. In order to get the EasyPusher-Android source code up and running on the latest Android Studio, several modifications need to be made to the downloaded EasyPusher-Android source code. The following modifications are based on Android Studio Dolphin (Dolphin version), and the detailed modification steps are described below.

1. Upgrade the compiled SDK version

Use Android Studio Dolphin to open the downloaded EasyPusher-Android project, and change both compileSdkVersion and targetSdkVersion inside the module from 26 to 28, because the small dolphin version of Android Studio supports up to API28 at the minimum.

2. Migration to Androidx

After modifying the module in the previous step, click "Sync Now" to synchronize the configuration changes. Wait for the synchronization is complete, in turn, select the top menu: Refactor → Migrate to AndroidX, said the App project to migrate to AndroidX support library, then Android Studio will automatically App project support library configuration and related classes are replaced with the corresponding object of AndroidX.

3、Specify the version number of the local NDK

Then select the top menu in turn: Build→Make Project, and found that the app compilation error "No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi "This is because Android Studio didn't find the right NDK version. The solution is to specify the version number of the local NDK in the configuration file (note that the corresponding version of the ndk is checked in the SDK Manager beforehand, see "12.1.1 Build Android NDK Development Environment" in Chapter 12 of the book "FFmpeg Development in Action: From Zero Basis to Short Video Online"), open the module, and then use the module to create a NDK development environment for Android. "), open the module, put the following line

    buildToolsVersion '28.0.3'

Replace it with the following line

    //buildToolsVersion '28.0.3'
    ndkVersion '21.4.7075529' // change the ndkVersion here to the ndk version on your own computer

Then click "Sync Now" to synchronize the configuration changes.

4. Upgrade the Gradle version number of the App project

Then select the top menu in turn: Build→Make Project, and found that the app compile error ": javax/xml/bind/JAXBException", this is because the default Gradle version of EasyPusher-Android is too low. The solution is to upgrade the Gradle version of EasyPusher-Android project, first change the value of distributionUrl in gradle/wrapper/ to the following one:

https\:///distributions/gradle-6.7.

Then change the node path buildscript→dependencies→classpath value inside the project level to the following:

':gradle:4.2.1'

Then click "Sync Now" to synchronize the configuration changes.

5. Compile and run EasyPusher-Android

Then select the top menu in turn: Build→Make Project, wait for the compilation through the top menu in turn: Run→Run 'app', in the debugging of the real machine you can see the EasyPusher-Android App interface as shown below.

Click the Settings button in the lower right corner of the App interface to open the Settings page as shown in the following figure, and pay attention to modifying the server-side push streaming address in the edit box above, such as rtsp://124.70.***. ***/live/test.

Note that since EasyPusher only supports RTSP push streaming, it does not support other push streaming protocols such as RTMP, so the above can only fill in the RTSP push streaming link. As for the server-side streaming server, you can use ZLMediaKit, about the use of ZLMediaKit instructions see the previous article "Linux environment to install ZLMediaKit to realize the video push streaming".

For more details on FFmpeg development seeFFmpeg Development in Action: From Zero Basics to Short Video OnlineA book.