Registered pipes can't be used on Windows

Aperta
#175 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, dart, flutter

Direzione di ricerca

Start by inspecting windows/src/FFmpegKitConfig.cpp around the linked lines 844–845 and trace how the registered pipe is created, returned, and closed. Compare that lifecycle with the working Android behavior described in the issue; reproduce by registering a pipe, opening it with Dart File(pipePath).openWrite(), and running the shown FFmpeg command. Done means Windows can open and feed the registered pipe and FFmpeg receives the streamed input.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi, I'm running into an issue with the custom Windows implementation when trying to register a pipe for an input file.

Here is the rough setup:

final pipePath = await FFmpegKitConfig.registerNewFFmpegPipe();
if (pipePath == null) {
  throw StateError('Failed to register new FFmpeg pipe');
}

await FFmpegKit.executeWithArgumentsAsync(
  [
    ...['-i', pipePath],
    ...['-af', 'ebur128'], // Measures loudness, produces logs every 100ms
    ...['-f', 'null'],
    '-',
  ],
  (session) {},
  (log) => print('[ffmpeg] ${log.getMessage()}'),
);

final ffmpegInputSink = File(pipePath).openWrite();

// Here you listen to a Stream<Uint8List> and pipe it to ffmpegInputSink,
// for example by using AudioRecorder().startStream() from the Flutter "record" package.

// ... when done:
await ffmpegInputSink.flush();
await ffmpegInputSink.close();
await FFmpegKitConfig.closeFFmpegPipe(pipePath);

On Android, this creates a pipe, which can be fed with a stream of data and then properly closed. The ffmpeg logs respond to the audio loudness as expected (everything works here).

On Windows, you also get back a valid pipePath (e.g. \\.\pipe\fk_pipe_1). However, this pipe doesn't actually exist. The File(pipePath).openWrite() command fails ("Cannot open file"), and the ffmpeg logs say:

[ffmpeg] \\.\pipe\fk_pipe_1: No such file or directory

I assume this has something to do with a line in FFmpegKitConfig.cpp, where the pipe gets closed before returning it to the Dart side:

https://github.com/sk3llo/ffmpeg_kit_flutter/blob/f1f7fe2d40f166ccfa76ca78d19ffa280f51e825/windows/src/FFmpegKitConfig.cpp#L844-L845

Apologies if the ffmpeg-kit repository would have been a better place for this issue. I wasn't sure, because the Windows source files are also part of this repository.

Anyway, thanks for maintaining this plugin!

Lingua principale
C
Stelle
182
Fork
122
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sk3llo/ffmpeg_kit_flutter

Tutte le issue di sk3llo/ffmpeg_kit_flutter

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.