├── .gitignore ├── GetVideoPic ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── ywl5320 │ │ │ └── getvideopic │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── ywl5320 │ │ │ │ └── getvideopic │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── ywl5320 │ │ └── getvideopic │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── README.md └── alphavideo ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── src ├── androidTest │ └── java │ │ └── com │ │ └── ywl5320 │ │ └── alphavideo │ │ └── ExampleInstrumentedTest.java ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ywl5320 │ │ │ └── alphavideo │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml └── test │ └── java │ └── com │ └── ywl5320 │ └── alphavideo │ └── ExampleUnitTest.java └── testvideos ├── demo_video.mp4 └── plane_x264.mp4 /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | .idea/workspace.xml 42 | .idea/tasks.xml 43 | .idea/gradle.xml 44 | .idea/assetWizardSettings.xml 45 | .idea/dictionaries 46 | .idea/libraries 47 | # Android Studio 3 in .gitignore file. 48 | .idea/caches 49 | .idea/modules.xml 50 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 51 | .idea/navEditor.xml 52 | 53 | # Keystore files 54 | # Uncomment the following lines if you do not want to check your keystore files in. 55 | #*.jks 56 | #*.keystore 57 | 58 | # External native build folder generated in Android Studio 2.2 and later 59 | .externalNativeBuild 60 | .cxx/ 61 | 62 | # Google Services (e.g. APIs or Firebase) 63 | # google-services.json 64 | 65 | # Freeline 66 | freeline.py 67 | freeline/ 68 | freeline_project_description.json 69 | 70 | # fastlane 71 | fastlane/report.xml 72 | fastlane/Preview.html 73 | fastlane/screenshots 74 | fastlane/test_output 75 | fastlane/readme.md 76 | 77 | # Version control 78 | vcs.xml 79 | 80 | # lint 81 | lint/intermediates/ 82 | lint/generated/ 83 | lint/outputs/ 84 | lint/tmp/ 85 | # lint/reports/ 86 | /GetVideoPic/.idea 87 | /GetVideoPic/gradle 88 | -------------------------------------------------------------------------------- /GetVideoPic/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /GetVideoPic/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /GetVideoPic/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | applicationId "com.ywl5320.getvideopic" 9 | minSdkVersion 16 10 | targetSdkVersion 29 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: "libs", include: ["*.jar"]) 27 | implementation 'androidx.appcompat:appcompat:1.1.0' 28 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 31 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 32 | implementation 'ywl.ywl5320:wlmedia:1.1.2' 33 | } -------------------------------------------------------------------------------- /GetVideoPic/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /GetVideoPic/app/src/androidTest/java/com/ywl5320/getvideopic/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.ywl5320.getvideopic; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.ywl5320.getvideopic", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /GetVideoPic/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /GetVideoPic/app/src/main/java/com/ywl5320/getvideopic/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ywl5320.getvideopic; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.Manifest; 7 | import android.os.Build; 8 | import android.os.Bundle; 9 | import android.os.Handler; 10 | import android.os.Message; 11 | import android.view.View; 12 | import android.widget.Button; 13 | import android.widget.ImageView; 14 | 15 | import com.ywl5320.wlmedia.WlMediaUtil; 16 | import com.ywl5320.wlmedia.bean.WlVideoImgBean; 17 | 18 | public class MainActivity extends AppCompatActivity { 19 | 20 | private ImageView ivImg; 21 | private ImageView ivImg2; 22 | private ImageView ivImg3; 23 | private Button btnAll; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 29 | requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0x01); 30 | } 31 | 32 | setContentView(R.layout.activity_main); 33 | ivImg = findViewById(R.id.iv_img); 34 | ivImg2 = findViewById(R.id.iv_img2); 35 | ivImg3 = findViewById(R.id.iv_img3); 36 | btnAll = findViewById(R.id.btn_all); 37 | 38 | ivImg3.setRotation(90); 39 | 40 | 41 | 42 | 43 | } 44 | 45 | public void getPic(View view) { 46 | new Thread(new Runnable() { 47 | @Override 48 | public void run() { 49 | WlMediaUtil wlMediaUtil = new WlMediaUtil(); 50 | wlMediaUtil.setSource("https://hjapi.51hejia.com/VID20191226144815.mp4"); 51 | int ret = wlMediaUtil.init(); 52 | if(ret == 0) 53 | { 54 | ret = wlMediaUtil.openCodec(); 55 | if(ret == 0) 56 | { 57 | WlVideoImgBean wlVideoImgBean = wlMediaUtil.getVideoImg(10, false); 58 | if(wlVideoImgBean != null) 59 | { 60 | Message message = Message.obtain(); 61 | message.obj = wlVideoImgBean; 62 | message.what = 0; 63 | handler.sendMessage(message); 64 | } 65 | } 66 | } 67 | wlMediaUtil.release(); 68 | } 69 | }).start(); 70 | } 71 | 72 | Handler handler = new Handler(){ 73 | @Override 74 | public void handleMessage(@NonNull Message msg) { 75 | super.handleMessage(msg); 76 | switch (msg.what) 77 | { 78 | case 0: 79 | WlVideoImgBean wlVideoImgBean = (WlVideoImgBean) msg.obj; 80 | ivImg.setImageBitmap(wlVideoImgBean.getBitmap()); 81 | break; 82 | case 1: 83 | WlVideoImgBean wlVideoImgBean2 = (WlVideoImgBean) msg.obj; 84 | ivImg2.setImageBitmap(wlVideoImgBean2.getBitmap()); 85 | break; 86 | case 2: 87 | WlVideoImgBean wlVideoImgBean3 = (WlVideoImgBean) msg.obj; 88 | ivImg3.setImageBitmap(wlVideoImgBean3.getBitmap()); 89 | break; 90 | case 3: 91 | btnAll.setText("逐帧获取图片"); 92 | break; 93 | } 94 | 95 | } 96 | }; 97 | 98 | public void getLocalPic(View view) { 99 | new Thread(new Runnable() { 100 | @Override 101 | public void run() { 102 | WlMediaUtil wlMediaUtil = new WlMediaUtil(); 103 | wlMediaUtil.setSource("/storage/sdcard0/Movies/GAI周延-大痒痒-哪吒 (《哪吒之魔童降世》电影主题曲)(蓝光).mp4"); 104 | int ret = wlMediaUtil.init(); 105 | if(ret == 0) 106 | { 107 | ret = wlMediaUtil.openCodec(); 108 | if(ret == 0) 109 | { 110 | WlVideoImgBean wlVideoImgBean = wlMediaUtil.getVideoImg(55, false); 111 | if(wlVideoImgBean != null) 112 | { 113 | Message message = Message.obtain(); 114 | message.obj = wlVideoImgBean; 115 | message.what = 1; 116 | handler.sendMessage(message); 117 | } 118 | } 119 | } 120 | wlMediaUtil.release(); 121 | } 122 | }).start(); 123 | } 124 | 125 | boolean start = false; 126 | public void getAllPic(View view) { 127 | if(!start) 128 | { 129 | btnAll.setText("停止"); 130 | start = true; 131 | new Thread(new Runnable() { 132 | @Override 133 | public void run() { 134 | WlMediaUtil wlMediaUtil = new WlMediaUtil(); 135 | wlMediaUtil.setSource("https://hjapi.51hejia.com/VID20191226144815.mp4"); 136 | int ret = wlMediaUtil.init(); 137 | if(ret == 0) 138 | { 139 | ret = wlMediaUtil.openCodec(); 140 | if(ret == 0) 141 | { 142 | while(true) 143 | { 144 | if(!start) 145 | { 146 | break; 147 | } 148 | WlVideoImgBean wlVideoImgBean = wlMediaUtil.getVideoImg(false); 149 | if(wlVideoImgBean != null) 150 | { 151 | Message message = Message.obtain(); 152 | message.obj = wlVideoImgBean; 153 | message.what = 2; 154 | handler.sendMessage(message); 155 | } 156 | else{ 157 | start = false; 158 | break; 159 | } 160 | try { 161 | Thread.sleep(5); 162 | } catch (InterruptedException e) { 163 | e.printStackTrace(); 164 | } 165 | } 166 | } 167 | } 168 | wlMediaUtil.release(); 169 | handler.sendEmptyMessage(3); 170 | } 171 | }).start(); 172 | } 173 | else{ 174 | start = false; 175 | } 176 | } 177 | } -------------------------------------------------------------------------------- /GetVideoPic/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /GetVideoPic/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /GetVideoPic/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 |