Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 717 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 717 Bytes

VideoShuffle

Shuffle video frame

打乱视频帧

可打乱视频内局部区域

打乱单元可为矩形,边长需要满足:打乱区域边长被单元边长整除

具体效果见 Bilibili视频

Example

详细例子见 VideoShuffle.Example

using Myitian.Shuffling;
using System.Drawing;

XShuffle xs = new XShuffle();
VideoShuffle vs = new VideoShuffle(new Size(1920, 1080), new Rectangle(0, 0, 120, 1080), new Size(120, 120));
byte[] buffer;

// ... read ffmpeg stdout, store a rawvideo frame in buffer ...

Frame frame = vs.LoadFrame(buffer); // load frame info
xs.Shuffle(frame); // shuffle frame

// ... write buffer to ffmpeg stdin ...