Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video not loading on Apple Devices #547

Open
baltermia opened this issue Nov 12, 2024 · 0 comments
Open

Video not loading on Apple Devices #547

baltermia opened this issue Nov 12, 2024 · 0 comments

Comments

@baltermia
Copy link

I'm generating a video file (with no sound) out of multiple GIFs. The GIFs are loaded from files but the final video is sent somewhere else using a MemoryStream. The ffmpeg saving logic looks like this:

IEnumerable <IVideoFrame> frames = CreateFrames();

MemoryStream outStream = new();

RawVideoPipeSource video = new(frames)
{
    FrameRate = _options.FPS,
};

await FFMpegArguments
    .FromPipeInput(video, options => options
        .WithFramerate(_options.FPS))
    .OutputToPipe(new StreamPipeSink(outStream), options => options
        .WithVideoCodec("vp9")
        .ForceFormat("webm")
        .UsingMultithreading(true))
    .ProcessAsynchronously();

The GIFs are loaded into memory using SkiaSharp and the frames are also generated using that library.

Now, on Windows (when I save the MemoryStream to a file using FileStream), I can view the video. Even when sending the stream over to a messenger API, it's viewable on Android devices.
But for Apple Devices nothing happens. I was tested on my iPhone and MacBook.

On Windows, it's also not perfectly working. For example, the video has no length for some reason. So I can only start/stop and go to start. And for some other people to whom I sent the video (over the messenger), they told me the video was 420 hours long.

I tried using different codecs and formats but that either tells me that the arguments are invalid or that the pipe is broken.

Any help would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant