init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
namespace VideoReader;
internal class SaveVideo
{
private unsafe AVFormatContext* pFormatContext;
private unsafe AVStream* st;
private unsafe void Write_Frame(byte[] buff, long number)
{
AVPacket aVPacket = default(AVPacket);
AVPacket* ptr = &aVPacket;
ffmpeg.av_init_packet(ptr);
IntPtr intPtr = Marshal.AllocHGlobal(buff.Length);
Marshal.Copy(buff, 0, intPtr, buff.Length);
ptr->data = (sbyte*)intPtr.ToPointer();
ptr->size = buff.Length;
ptr->pts = ffmpeg.av_rescale_q(number, st->codec->time_base, st->time_base);
int num = ffmpeg.av_interleaved_write_frame(pFormatContext, ptr);
Marshal.FreeHGlobal(intPtr);
ffmpeg.av_free_packet(ptr);
}
}