Orientação gerada a partir de informações públicas. Apenas para referência.
Um pacote Flutter projetado para cortar vídeos em aplicativos móveis. Permite aos usuários recuperar arquivos de vídeo, cortá-los entre tempos personalizados de início e fim, e salvar os trechos resultantes no sistema de arquivos do dispositivo. O pacote suporta tanto plataformas Android quanto iOS, oferecendo uma experiência fluida para edição de multimídia diretamente nos aplicativos. É ideal para aplicações que exigem manipulação básica de vídeo sem depender de serviços externos.
Casos de uso
Recortando vídeos carregados pelo usuário
Criando cliques de vídeo curtos a partir de gravações mais longas
Integrando edição de vídeo em aplicativos de mídia social
Preparando conteúdo de vídeo para compartilhamento
Editar vídeos de tutorial ou demonstração
Salvar vídeos cortados localmente
Principais recursos
Recuperar vídeos do armazenamento do dispositivo
Recorte vídeos com seleção precisa do tempo
Salvar vídeos cortados para o sistema de arquivos
Suporta Android e iOS
API simples para integração
Preserva a qualidade original do vídeo
Indicado para
Aplicativos móveis que precisam cortar vídeos
Ferramentas de mídia social ou criação de conteúdo
Aplicativos educacionais ou tutoriais
Aplicativos que processam conteúdo de vídeo gerado pelo usuário
Desenvolvedores construindo editores multimídia
Considerações
Requer permissões de sistema de arquivos no Android e no iOS
Arquivos de vídeo grandes podem afetar o desempenho
Limitado a cortes básicos (sem edição avançada)
Pode ser necessário o tratamento de tamanhos de arquivo grandes
Depende das capacidades nativas da plataforma para processamento de vídeo
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
A Flutter package for trimming videos
Features
Customizable video trimmer.
Supports two types of trim viewer, fixed length and scrollable.
Video playback control.
Retrieving and storing video file.
Also, supports conversion to GIF.
NOTE: Versions 5.0.0 and above uses a native video trimmer without the overhead of FFmpeg. Have a look at the Changelog for breaking changes if you are below version 5.0.0.
Following image shows the structure of the TrimViewer. It consists of the Duration on top (displaying the start, end, and scrubber time), TrimArea consisting of the thumbnails, and TrimEditor which is an overlay that let's you select a portion from the video.
Example
The example app running on an iPhone 13 Pro device:
Usage
Add the dependency video_trimmer to your pubspec.yaml file:
For using main version of FFmpeg package:
dependencies:video_trimmer:^5.0.0
Android configuration
No additional configuration is needed for using on Android platform. You are good to go!
iOS configuration
Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string><key>NSMicrophoneUsageDescription</key><string>Used to capture audio for image picker plugin</string><key>NSPhotoLibraryUsageDescription</key><string>Used to demonstrate image picker plugin</string>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.