8000 GitHub - kibotu/SequentialImagePlayer
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kibotu/SequentialImagePlayer

Repository files navigation

SequentialImagePlayer

Maven Central Version Android CI API API API Gradle Version Kotlin

Native Sequential Image Player. Supports different FPS, auto play, and scrubbing forwards and backwards.

Screenshot

Screenshot

How to install

MavenCentral

allprojects {
    repositories {
        mavenCentral()
    }
}

dependencies {
    implementation 'net.kibotu:SequentialImagePlayer:{latest-version}'
}

Jitpack

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.kibotu:SequentialImagePlayer:{latest-version}'
}

How to use

As view

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.exozet.sequentialimageplayer.SequentialImagePlayer
        android:id="@+id/sequentialImagePlayer"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
private fun startSequentialPlayer(list: List<Uri>) = with(sequentialImagePlayer) {
    imageUris = list.toTypedArray()
    autoPlay = true
    fps = 30
    playBackwards = false
    zoomable = true
    translatable = true
    showControls = false
    swipeSpeed = 0.7f
    blurLetterbox = true
}

As Standalone Activity

Start 360 Degree Activity by passing a bitmap file path or a bitmap

(1 until 192).map { parseAssetFile(String.format("stabilized/out%03d.png", it)) }.toTypedArray()

SequentialImagePlayerActivity.Builder
.with(this)
    .uris(list)
    .fps(24) // default: 30
    .playBackwards(false) // default: false
    .autoPlay(false) // default: true
    .zoomable(true) // default: true
    .translatable(true) // default: true
    .showControls(true) // default: false
    .swipeSpeed(0.8f) // default: 1 
    .blurLetterbox() // default:true 
    .startActivity() 

Misc

Stabilize video

(Sauce: https://scottlinux.com/2016/09/17/video-stabilization-using-vidstab-and-ffmpeg-on-linux/)

ffmpeg -i example_walkaround.mov -vf vidstabdetect=shakiness=10:accuracy=15 -f null -
ffmpeg -i example_walkaround.mov -vf vidstabtransform=smoothing=30:input="transforms.trf" example_walkaround_stabilized.mp4

Merge 2 videos horizontally

ffmpeg -i example_walkaround.mov -i example_walkaround_stabilized.mp4 -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" merged.mp4

Extract frames from video

# 3 frames per second
ffmpeg -i example_walkaround_stabilized.mp4 -r 3/1 app/src/main/assets/out%03d.png

Resize images

mogrify -resize 1024x app/src/main/assets/default/*

Optimize pngs

pngquant app/src/main/assets/default/**.png --ext .png --force

Changelog

2.0.0

  • Replaced kotlin extensions by view binding
  • Android 15 Support
  • Library Updates
    • Kotlin 2.1.0
    • gradle wrapper update to 8.11.1
    • gradle build tools to 8.7.2
    • gradle.settings overhaul

1.5.3

  • Supports onProgressChanged events, e.g.: degreeIndicator.rotation = it * 360 }
  • Supports blurry letterbox effect
  • Supports being added as custom view
  • Supports translatable
  • Supports swipe speed
  • Supports swiping
  • Supports showing controls
  • Supports autoplay backwards
  • Supports autoplay
  • Supports custom FPS
  • Supports pinch zoom
  • Supports orientation changes
  • Supports loading indicator
  • Supports loading from asset-folder
  • Supports loading from internal storage
  • Supports loading from external storage
  • Supports loading from file

Contributors

Jan Rabe

LICENSE

Copyright 2024 Jan Rabe

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published
0