

GetUnsafeBufferPointerWithoutChecks(bitmapData) var pBitmapData = (byte*)NativeArrayUnsafeUtility Var bitmapData = GetBitmapData(frameFile) Using var vse = new H264VideoStreamEncoder(fs, fps, destinationSize) Using var fs = File.Open(outputFileName, FileMode.Create) Using (var vfc = new VideoFrameConverter( Var destinationPixelFormat = AVPixelFormat.AV_PIX_FMT_YUV420P Var sourcePixelFormat = AVPixelFormat.AV_PIX_FMT_RGB24

Var sourceSize = new Size(fistFrameImage.width, fistFrameImage.height) OutputFileName = Path.ChangeExtension(outputFileName, ".h264") Public static unsafe void EncodeImagesToH264(Texture2D images, int fps, string outputFileName)įFmpegBinariesHelper.RegisterFFmpegBinaries() Also, info on what steps I'd need to take to produce valid files in a few different formats and an overview of the common settings that those format encoders support would be awesome. I though the issue might be related to the step where the c++ examples append an endcode set of bytes to the file but that hasn't fixed it.Īny guidance on what steps I'm missing to turn the output into a 'valid' video would be greatly appreciated. I have build and run the Example project and can see the same issues with the video it produces from the Bunny video it first decodes then encodes to H264. It's like VLC is lagging at the start for some reason
PACKETSTREAM API CODE
I've taken the FFmpegHelper, VideoFrameConverter, H264VideoStreamEncoder classes straight from the, rolled my own FFmpegBinariesHelper class and Size struct and mangled the EncodeImagesToH264 from Program.cs to look like the below code snippets.
