Paper 插件,无需客户端模组即可在游戏中回放视频(及音频)。
功能
- 播放本地 MP4/MKV/AVI/WEBM/MOV 文件,或直接下载 YouTube 上的视频(可选)
- 实验性 全 RGB 模式,无需任何抖动处理,从而获得 优于 类似插件的图像质量。
- 直接通过 Twitch 或 YouTube 的 URL 播放直播流(无音频)。
- 自动生成并托管资源包,以同步播放视频音频。
- 支持真正的 1080p 甚至 4K 回放,采用高效的基于瓦片的渲染技术
- 唯一限制是服务器和玩家的带宽。
- 显著改善带宽使用率。对于超大屏幕(2176x896),带宽可低至 8 MB/s。
- 显著提升画质
- 使用 Floyd-Steinberg、Stucki 或 Atkinson 抖动算法,并配合时间降噪
- 完整的播放控制:暂停、继续、跳转和跳过
- 音频被分割成无缝块,以绕过 Minecraft 的音频限制
- 使用多种压缩技术,仅更新实际需要的内容,尽可能减少带宽占用
- 选择性更新、下采样、脏区域检测等
基本用法
所有命令均提供有帮助的自动补全功能
- 面向左下角位置时使用
/mcc create <screen id> <aspect ratio> [x] [y]创建屏幕- 提示:确保屏幕光照均匀,例如使用光源方块。
- 将视频
.mp4文件放入/plugins/MCCinema/videos/ - 使用
/mcc play <screen id> <video>开始播放。可选择包含--audio <chunk size>参数以启用音频播放。- 对于音频,此插件默认使用 mcpacks.dev 进行资源包托管。
- 或者,如果启用了音频,它可以自动托管一个资源包服务器。在某些主机上这可能会失败。
- 为了允许恢复和暂停播放,音频数据被分割成长度为
<chunk size>秒的块。默认值 10s 通常效果良好。 - 使用
--experimental标志以启用全 RGB 模式。
- 你可以使用
/mcc quality <screen> <performance/balanced/quality>更改播放质量设置。这将显著影响带宽和 CPU 使用率。 - 在本地视频播放时,使用
/mcc crop <screen>调整其视口。滚动鼠标滚轮缩放,使用 W/A/S/D 平移,按住潜行键进行精确调整。保存的裁剪设置会在再次播放该视频时复用。
要从 YouTube 下载视频,请运行 /mcc download。
首次使用需要一些设置。MCC 为此使用 yt-dlp。系统将要求你确认下载 yt-dlp。
当然,你也可以始终手动下载 YouTube 视频并将其放置到 /videos/ 目录中!
关于带宽使用的说明:
此插件不可避免地会产生大量流量。Minecraft 本身并不是一个优秀的视频播放器。
尽管已尽可能优化(可能优于许多类似插件),但流量仍然可能很大。
实际产生的流量取决于两个因素:屏幕大小和视频的动态程度。像幻灯片这样几乎没有移动的视频几乎不会产生任何流量。
你可以使用 /mcc debug <screen id> 查看实时指标,包括带宽使用情况。但请注意,这些指标是在压缩之前的。你可以按 F3+3 获取内置带宽图,它将显示压缩后的带宽。
在一个合理大小的屏幕(7x4 方块,896x512)上的示例:
- Server Trailer:平均 3 MB/s
- 这种屏幕尺寸足以满足大多数内容的分辨率需求
在一个非常大的屏幕(17x7 方块,2176x896)上的两个示例:
使用 Velocity 代理,配置为 compression-threshold: 256 和 compression-level: 4
- Bad Apple:平均 400 KB/s
- 仅有两种颜色,两侧有信箱模式,大量同色区域 -> 较低的带宽使用
- Bite Marks:平均 8 MB/s
- 色彩丰富,全屏 CS 格式,场景切换极快 -> 较高的带宽使用
配置
你可以在 这里 找到完整且带有注释的配置文件。
其他注意事项:
- 此插件大量使用多线程,因此更多更快的 CPU 核心会带来显著的性能提升。
- 视频和音频是流式传输的,因此 RAM 使用不应成为主要问题。但是,此插件会产生相当大的 GC 压力。
- 建议在服务器前使用 Velocity 代理,并在
server.properties中禁用network-compression-threshold。这样做会将数据包压缩和加密的工作卸载给代理,从而显著提高性能和吞吐量。如果无法做到这一点,考虑增加 spigot.yml 中的netty-threads可能值得一试。 如果使用 Velocity,尝试调整network-compression-threshold和compression-level设置。我分别使用256和4取得了很好的效果。 - 数据包是按帧捆绑的,因此每秒数据包数在此处不应成为问题。
- 你可以在视频播放期间使用
/mcc debug <screen> <setting> <value>调整大部分配置设置。根据视频内容,调整设置可能会有很大影响(例如动漫风格与写实风格视频)。
展示
超大屏幕(17x7 方块,2176x896 CS)以 24FPS 播放
支持更大的屏幕尺寸,但你可能会遇到带宽限制
Paper plugin to play back video (and audio) in-game without the use of clientside mods.
Features
- Play local MP4/MKV/AVI/WEBM/MOV files or download videos directly from YouTube (optional)
- Experimental full RGB mode, which works without any dithering leading to a superior image quality compared to similar plugins.
- Play Livestreams directly from Twitch or YouTube by simply using an URL instead (no audio).
- Automatic resource pack generation and hosting for synchronized audio playback for videos.
- True 1080p or even 4K playback with efficient tile-based rendering
- Only limit is the server and player bandwidth.
- Improved bandwidth usage. Down to 8 MB/s for a really large (2176x896) screen.
- Significantly improved visual quality
- Floyd-Steinberg, Stucki or Atkinson dithering with temporal noise reduction
- Full playback controls: pause, resume, seek, and skip
- Audio is sliced into seamless chunks to work around Minecraft's audio limitations
- Various compression techniques are used to reduce bandwidth usage as much as possible by only updating whats actually needed
- Selective updating, downsampling, dirty region detection and more
Basic usage
All commands have helpful tab-completion available
- Use
/mcc create <screen id> <aspect ratio> [x] [y]while looking at the lower left corner to create a screen- Tip: Make sure your screen is evenly lit, e.g. using light blocks.
- Place your video
.mp4files in/plugins/MCCinema/videos/ - Use
/mcc play <screen id> <video>to start playback. Optionally include the--audio <chunk size>parameter to play with audio.- For audio, this plugin will use mcpacks.dev for Resourcepack hosting by default.
- Alternatively, it can automatically host a resourcepack server if audio is enabled. On some hosts this may fail.
- To allow for resuming and pausing of playback, audio data is split into chunks of
<chunk size>seconds in length. The default value of 10s is usually good. - Use the
--experimentalflag to enable full RGB mode.
- You can use
/mcc quality <screen> <performance/balanced/quality>to change playback quality settings. This will have a significant effect on bandwidth and CPU usage. - Use
/mcc crop <screen>while a local video is playing to adjust its viewport. Scroll to zoom, use W/A/S/D to pan, and hold sneak for precise adjustments. The saved crop is reused whenever that video is played again.
To download videos from YouTube, run /mcc download.
There is some first-time setup required for this. MCC uses yt-dlp for this. You will be asked to confirm the yt-dlp download.
But of course you can also always download YouTube videos manually and place them in /videos/ yourself!
A note on bandwidth usage:
This plugin will inevitably create a lot of traffic. Minecraft isn't really a great video player.
This is optimized as best as possible (and likely better than many similar plugins), however it can still be a lot.
The actual amount of traffic scales with two factors: Screen size, and how dynamic the video is. Videos with very little movement such as slideshows will barely generate any traffic.
You can see live metrics, including bandwidth usage, using /mcc debug <screen id>. However note that those metrics are before compression. You can press F3+3 to get the built-in bandwidth graph, which will give you after compression bandwidth.
One example on a reasonably sized (7x4 blocks, 896x512) screen:
- Server Trailer: Average 3 MB/s
- This screen size gives you good enough resolution for most content
Two examples on a very large (17x7 blocks, 2176x896) screen:
Using Velocity with compression-threshold: 256 and compression-level: 4
- Bad Apple: Average 400 KB/s
- Only two colors, pillarboxing on both sides, many large same-color areas -> lower bandwidth usage
- Bite Marks: Average 8 MB/s
- Many colors, full CS format, very quick scenes -> high bandwidth usage
Configuration
You can find a full, commented configuration file here
Additional notes:
- This plugin makes heavy use of multi-threading and benefits from more and faster CPU cores significantly.
- Video and audio are streamed, so RAM usage should not be a meaningful concern. However, this plugin will create considerable GC pressure.
- It is recommended to use a Velocity proxy in front of your server, and to then disable
network-compression-thresholdinserver.properties. Doing so will offload the work of compressing and encrypting packets to the proxy, which can significantly improve performance and throughput. If that is not possible, increasingnetty-threadsin spigot.yml might be worth considering. If using Velocity, try playing around with thenetwork-compression-thresholdandcompression-levelsettings a bit. I had great results with256and4respectively. - Packets are bundled per frame, so packets-per-second should not be a concern here.
- You can tweak most config settings during video playback with
/mcc debug <screen> <setting> <value>. Depending on the video content, tweaking settings might have a big effect (e.g. anime style vs real life videos).
Showcase
Very large screen (17x7 blocks, 2176x896 CS) playing at 24FPS
Even larger screen sizes are supported, but you will run into bandwidth limitations
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
下载 MCCinema
-
/mcc list videos现在会显示每个视频的悬停提示,展示详细信息。 -
从 YouTube 下载视频时,字幕现在也会自动下载。
-
字幕现在以
<视频文件名>.<语言代码>.srt的格式存储在/videos/subtitles/目录中。你也可以在此处手动添加字幕。 -
在 RGB 模式下,元数据现在使用图像顶部几行进行传输,而非左上角的三个黑色方块。这样应该更加隐蔽。
-
修复了一个音频播放会在第一帧完全解码前就开始的 bug。
-
修复了一个区域更新问题,在 RGB 模式下字幕更改时不会正确更新图像。
-
修复了一个缩放或裁剪后的视频播放速度远低于原生播放速度的问题。
- 现已支持字幕功能。
/mcc subtitle- 玩家可自行切换自己的字幕显示
- 管理员(拥有
mccinema.subtitle.admin权限)可为所有观众切换字幕 - 管理员添加的字幕为硬字幕,并支持所有格式;玩家添加的字幕则使用动作栏(action bar)显示
- 改进了实验性编解码器,大幅降低了带宽占用
- 现在该编解码器也会遵循
/mcc quality的设置
- 现在该编解码器也会遵循
- 现已支持播放(未加密的)DCP 文件。名称中包含“cinema”的插件应支持影院格式
- 通过
/mcc play ... --experimental添加了实验性的 RGB 胶片播放功能。- 保留每张地图完整的 128×128 分辨率。服务器以 4×4 色度和梯度数据编码每个像素的亮度;Minecraft 核心着色器在客户端重建 RGB 图像。
- 这应能改善色彩表现和细节,尤其在噪点较多的场景和真实视频内容中。缺点是画面可能看起来稍显柔和。
- 优化了帧适配和图块编码,以获得更一致的播放性能。
- 添加了
.mov视频支持。 /mcc seek现在会在暂停时渲染所选帧。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧