Ejemplo n.º 1
0
 public static void SaveSound(string path, byte[] data, int sampleCount, int targetSampleRate)
 {
     using (FFmpegContext ffContext = FFmpegContext.Write(path))
     {
         ffContext.SetOutputFormat(AVCodecID.AV_CODEC_ID_NONE, targetSampleRate, sampleCount, AVSampleFormat.AV_SAMPLE_FMT_S16);
         ffContext.WriteHeader();
         ffContext.WriteFrame(data);
     }
 }
Ejemplo n.º 2
0
 // compression level [0-9]
 public static void SaveImagePNG(string path, byte[] data, int width, int height, int compression = 1)
 {
     using (FFmpegContext ffContext = FFmpegContext.Write(path))
     {
         ffContext.SetOutputFormat(AVCodecID.AV_CODEC_ID_PNG, width, height, AVPixelFormat.AV_PIX_FMT_BGRA, compression);
         ffContext.WriteHeader();
         ffContext.WriteFrame(data);
     }
 }