Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rafa Castillo Passols
/
Prototipo-Multimedia
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
85efb35b
authored
May 26, 2025
by
Rafa Castillo Passols
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Cambiado el comando para obtener fotogramas de un video. Falta calcular timestamp
parent
420968f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
lib/paginas/pagina_fotograma.dart
lib/paginas/pagina_fotograma.dart
View file @
85efb35b
...
...
@@ -4,6 +4,7 @@ import 'package:ffmpeg_kit_flutter_new/ffmpeg_kit.dart';
import
'package:ffmpeg_kit_flutter_new/ffmpeg_session.dart'
;
import
'package:ffmpeg_kit_flutter_new/ffprobe_kit.dart'
;
import
'package:ffmpeg_kit_flutter_new/ffprobe_session.dart'
;
import
'package:ffmpeg_kit_flutter_new/return_code.dart'
;
import
'package:flutter/material.dart'
;
import
'package:path_provider/path_provider.dart'
;
...
...
@@ -215,11 +216,15 @@ class _PaginaFotogramaState extends State<PaginaFotograma> {
Future
<
File
>
loadFotograma
(
int
fotograma
)
async
{
final
directory
=
await
getApplicationSupportDirectory
();
FFmpegSession
session
=
await
FFmpegKit
.
executeAsync
(
'ffmpeg -i
${widget._archivo.file.absolute.path}
-vf "select=eq(n
\
,
$fotograma
)" -vframes 1
${directory.absolute.path}${Platform.pathSeparator}
fotograma.png'
);
return
File
(
'
${directory.absolute.path}${Platform.pathSeparator}
fotograma.png'
);
// Este comando extrae un frame del timestamp dado. Por ahora solo extrae el primer frame
// TODO: CONVERTIR FOTOGRAMA A TIMESTAMP
String
pathArchivo
=
widget
.
_archivo
.
file
.
absolute
.
path
;
String
pathSalida
=
'
${directory.absolute.path}${Platform.pathSeparator}
fotograma.png'
;
// La opción -y acepta hacer overwrite
// Si se quiere añadir timestamp se hace con -ss 00:00:00
String
commando
=
'-y -i
$pathArchivo
-frames:v 1
$pathSalida
'
;
FFmpegSession
session
=
await
FFmpegKit
.
executeAsync
(
commando
);
return
File
(
pathSalida
).
create
();
}
Future
<
void
>
removeFotograma
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment