Trimming of video
See original GitHub issueI have not found a way in the docs on how to trim the video down to a portion of the original (e.g. from x milliseconds to y milliseconds).
Seems to me that I could implement by creating a custom MediaSource
and supplying it to the transform
method.
Am I on the right track here or is there an already built in way that I am currently missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Free Video Trimmer: Cut Videos Online | Adobe Express
Trimming a video is when you remove footage from the beginning or end of clip, usually to bring the focus in to the...
Read more >Video Trimmer - Cut Video Online for Free - MP4, AVI, MPG ...
Use our Online Video Trimmer to cut a fragment from any video! It supports any video format - MP4, AVI, 3GP, and many...
Read more >Video Trimmer — Cut Video Online
Fast Video Cutting. The tool allows you to move the two markers to select the beginning and ending of your clip. It takes...
Read more >Online Video Cutter - Cut, Trim & Crop Video for Free
Drag & drop your video files to cut, crop and trim. No account needed. ... With VEED you can cut and trim your...
Read more >Online Video Trimmer — Trim and Cut Videos
The online video trimmer from Kapwing is the fastest way to cut a video to your desired duration. You can trim by dragging...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done and merged: https://github.com/linkedin/LiTr/pull/71
Made some more progress! Instead of making a custom decoder, I ended up adding new logic to the
VideoTrackTranscoder
’sresizeDecodedInputFrame()
method.This is the logic that method currently uses to render frames (see the file here):
This logic assumes we want to render every frame in the video (the first line’s
true
parameter tells the decoder to render, and the second line performs the render). For trimming, there are frames we don’t want to render! I updated the logic to this:And this gives us a precisely trimmed output!
I haven’t cleaned anything up into more presentable code, but maybe next week I’ll have some time to get a draft PR up. Right now, I’m hardcoding my trim start and end values in a few places, so I’ll need to make a single spot for those parameters to be set.