Java Code Examples for android.media.MediaMuxer#setOrientationHint()

The following examples show how to use android.media.MediaMuxer#setOrientationHint() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaMuxerMediaTarget.java    From LiTr with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public MediaMuxerMediaTarget(@NonNull String outputFilePath, @IntRange(from = 1) int trackCount, int orientationHint, int outputFormat) throws MediaTargetException {
    this.outputFilePath = outputFilePath;
    this.trackCount = trackCount;

    try {
        mediaMuxer = new MediaMuxer(outputFilePath,  outputFormat);
        mediaMuxer.setOrientationHint(orientationHint);

        numberOfTracksToAdd = 0;
        isStarted = false;
        queue = new LinkedList<>();
        mediaFormatsToAdd = new MediaFormat[trackCount];
    } catch (IllegalArgumentException illegalArgumentException) {
        throw new MediaTargetException(INVALID_PARAMS, outputFilePath, outputFormat, illegalArgumentException);
    } catch (IOException ioException) {
        throw new MediaTargetException(IO_FAILUE, outputFilePath, outputFormat, ioException);
    }
}
 
Example 2
Source File: VideoCutAction.java    From SimpleVideoEditor with Apache License 2.0 5 votes vote down vote up
private void prepare() throws IOException {
    mMediaExtractor = new MediaExtractor();
    mMediaExtractor.setDataSource(mInputFile.getAbsolutePath());
    //  out put format is mp4
    mMediaMuxer = new MediaMuxer(mOutputFile.getAbsolutePath(),
            MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
    mMediaMuxer.setOrientationHint(VideoUtil.getVideoRotation(mInputFile));
}
 
Example 3
Source File: VideoMergeAction.java    From SimpleVideoEditor with Apache License 2.0 4 votes vote down vote up
private void prepare() throws IOException {
    mediaMuxer = new MediaMuxer(mOutputFile.getAbsolutePath(), MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
    mediaMuxer.setOrientationHint(VideoUtil.getVideoRotation(mInputFile));
}
 
Example 4
Source File: VideoBgmRemoveAction.java    From SimpleVideoEditor with Apache License 2.0 4 votes vote down vote up
private void prepare() throws IOException {
    mMediaExtractor = new MediaExtractor();
    mMediaExtractor.setDataSource(mInputFile.getAbsolutePath());
    mMediaMuxer = new MediaMuxer(mOutputFile.getAbsolutePath(), MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
    mMediaMuxer.setOrientationHint(VideoUtil.getVideoRotation(mInputFile));
}