예제 #1
0
        public void EncodeH264Frames()
        {
            var inputFrames = FFmpegAutoGen.DecodeFrames(ResourceInfo.From("count-video.mp4"));

            var finfo = AttachmentInfo
                        .From("output.h264")
                        .WriteVideo(inputFrames.Select(item => item.bitmap));

            foreach (var(bitmap, state) in FFmpegAutoGen.DecodeFrames(finfo.FullName))
            {
                var data = string.Join(" ", state.State);
                TestContext.WriteLine(data);
            }
        }
예제 #2
0
        public void DecodeMp4Frames()
        {
            foreach (var(bitmap, state) in FFmpegAutoGen.DecodeFrames(ResourceInfo.From("count-video.mp4")))
            {
                var data = string.Join(" ", state.State);
                TestContext.WriteLine(data);

                var idx = state.State["index"];

                bitmap
                .AsSpanBitmap()
                .ToMemoryBitmap()
                .Save(AttachmentInfo.From($"frame{idx:D3}.jpg"));
            }
        }