Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
Last active April 16, 2020 17:05
Show Gist options
  • Save shaobin0604/3d5464a478a84fce0c40c521834f8d16 to your computer and use it in GitHub Desktop.
Save shaobin0604/3d5464a478a84fce0c40c521834f8d16 to your computer and use it in GitHub Desktop.
exoplayer play video files in resource/raw
private MediaSource buildRawMediaSource() throws RawResourceDataSource.RawResourceDataSourceException {
RawResourceDataSource rawDataSource = new RawResourceDataSource(this);
// open the /raw resource file
rawDataSource.open(new DataSpec(RawResourceDataSource.buildRawResourceUri(R.raw.test11_rotate_270)));
return new ProgressiveMediaSource.Factory(new DefaultDataSourceFactory(this, "ExoTest")).createMediaSource(rawDataSource.getUri());
}
exiftool -rotation=90 video.mp4
ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=<x> output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment