2

I would like to stream a video that I receive via the SRT-Protocol (https://www.srtalliance.org/).

Unfortunately the flutter video_player does not support the SRT protocol. As the protocol is written in C/C++ I implemented a wrapper with dart:ffi and now I can connect to my Server that is streaming a video (apple h264) with SRT. I can receive the packets from the stream but now I don't know how to play a video from these packets. My approach so far: creating a temporary file

var dir = Directory.systemTemp.createTempSync();
var temp = File("${dir.path}/$fileName").createSync();

then write to incoming packets to the temp file and pass it to the video_player as file.

temp.writeAsBytesSync(receivedPackets*emphasized text*, mode: FileMode.append, flush: false);

The video_player is not opening the file (h264) and I receive the following error message.

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Cannot Open, null, null)

I would appreciate any help in order to solve this issue!

tobisweb
  • 41
  • 2

0 Answers0