Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement media time trim feature. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CharlesLin99 wants to merge 2 commits into ypresto:master
base: master
Choose a base branch
Loading
from CharlesLin99:master

Conversation

@CharlesLin99
Copy link

@CharlesLin99 CharlesLin99 commented Mar 4, 2016

Add class MediaTrimTime to hold trim duration.
Apply start time by invoking seekTo of MediaExtractor.
In VideoTrackTranscoder and PassThroughTrackTranscoder, check the sample time and make it not pass the trim end time.

mariotaku, strayerM, and junyuecao reacted with thumbs up emoji
Copy link
Author

@ypresto, Can you consider this feature?

Copy link
Owner

ypresto commented Mar 24, 2016

Perhaps some kind of interface to pass multiple, optional parameter is necessary.
I think builder pattern suits this.

Copy link
Owner

ypresto commented Mar 24, 2016

I'm afraid of device compatibility because of flush() bug: #8

Copy link

@ypresto

I have a need for this capability as well. Can you clarify the similarity regarding the seek that is done in this PR vs the flush bug that you corrected by queuing output. Am happy to work on this. Obviously we don't want any device compatibility issues.

Copy link
Owner

ypresto commented Jul 25, 2016

@selsamman

flush() was used to seek to beginning of video after determining output format.
That's why I thought similar issues can happen on some devices.
If you have affected device (or one has similar SoC), it can be tested without problems.
(Or AWS device farm can be used. Power of money 😎 )

Copy link

@ypresto

Sorry to be so dense here. If I understand the original problem it was that it was not cool to essentially do an extra partial extraction just to determine the input format and then reset everything and flush. Instead you had to determine the format on-the-fly as you were decoding and queue everything until the decoder ran long enough to provide that format info.

But I don't see any flush being done in this PR. It just does a seek. Is that somehow doing a flush under the covers? I am new to MediaCodec.

BTW thanks for pointing me to the AWS device farm. That could be a game changer :-)

Copy link
Owner

ypresto commented Jul 26, 2016

Ah, you're right, flush()ing is different than skipping leading frames (seeking).
I'm afraid that just skipping frames can cause another unexpected codec bug or not.
I'll test with device farm about it.

ypresto referenced this pull request in ergovia-devs/android-transcoder Aug 1, 2016
Copy link

@ypresto I think this is a useful feature. Please consider to merge it.

Copy link

Without a doubt this is an interesting feature. Are there any plans of adding it in the future?

Copy link

@CharlesLin99 , Thank you very much for your code of trim feature, It's useful! @sebadelcampo1 You can change your code according to this pull request , but you should let the function "createAudioOutputFormat" of all classes that implements "MediaFormatStrategy" return null, because "AudioTrackTranscoder" class doesnt have trim feature.

Copy link

aweck commented May 31, 2019

I would also like to have this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@sebadelcampo1 sebadelcampo1 sebadelcampo1 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /