forked from faush01/StrmExtract
-
Notifications
You must be signed in to change notification settings - Fork 24
片头探测 ‐ 播放行为
sjtuross edited this page Nov 26, 2024
·
4 revisions
这是一个简易版片头片尾标记的解决方案,基于看片的行为来判断。不需要大量扫片分析片头片尾,节省流量。具体看以下操作说明。
自动探测依赖Emby的事件机制,第三方客户端的事件触发可能支持不完善,会影响探测的准确性,因此探测限制为所有官方客户端。片头片尾数据是Emby原生,只要支持跳片头的第三方客户端都可以利用,至于是否能自动跳过取决于客户端实现。
- 一般使用不需要注意以下那么多细节,只要第1集正常快进到片头即可,看完正片在片尾开始处点下一集或退出播放即可,后续更新全自动处理。
- 本插件不依赖
Chapter API
插件,可独立工作,安装Chapter API
插件可用来辅助查看或编辑片头片尾标记。 - 当多用户同时播放,以第一个记录到的为准,但数据不会串。
- 支持Strm/软链接/直连模式,由
仅包含Strm
选项控制。
预设最大片头时长为150秒 (即2分30秒),最大片尾时长为360秒 (即6分钟),最小开头剧情时长为60秒,一般都不用修改。
- 开始播放第1集 (其实任意一集都可以)
- 在默认2分30秒范围内多次快进或倒退,最终在1分50秒开始观看正片
- 看到2分30秒时会自动记录片头时间点为1分50秒,并自动更新后续各集的片头标记
- 假设本集时长为45分30秒,在43分30秒时退出播放或者继续下一集
- 此时认为片尾时长为2分钟,在预设的6分钟范围内,自动记录本集的片尾时间点为43分30秒
- 基于此2分钟片尾时长,倒推本季后续各集的片尾时间点并自动更新
- 开始播放第1集 (其实任意一集都可以)
- 从头观看剧情至少60秒(可配置)
- 在1分30秒开始快进,片头探测时长自动延长1分30秒,即加上默认的2分30秒至4分钟
- 在4分钟内多次快进或倒退,最终在3分50秒开始观看正片
- 看到4分钟时自动记录片头时间段为1分30秒至3分50秒,并自动更新后续各集的片头标记
- 以上自动检测仅当片头或片尾标记不存在时才会触发
- 当有片头标记时,在默认2分30秒范围内,按暂停然后继续播放,重设当前以及后续各集的片头标记
- 当有片尾标记时,在离当前集结束前默认的6分钟内,按暂停然后继续播放,重新计算片尾时长,然后重设当前以及后续各集的片尾标记
- 为避免事件激发,重设操作需间隔10秒
- 为避免因长时间暂停误触发重设,重设操作需在5秒内完成
大致同案例四,注意以下几点:
- 接受重设的时间范围为:原有片头的开始时间点至2分30秒或原有片头的结束时间点(二者取大)。片头的结束时间点会被重设,而原有片头的开始时间点会被保留。
- 如果上面一点不能满足需求,用
Chapter API
插件删除第一集的片头标记,然后按照案例三操作即可。
- 某一季的任意集存在片头或片尾标记,当此季后续有更新时,会自动提取媒体信息,然后自动同步片头和片尾标记。
- 当播放的集所属季未曾提取过媒体信息,在更新片头或片尾标记前会自动先提取媒体信息,因此会有30秒左右的更新延迟。
- 有一个清除片头片尾的计划任务,可手工运行,清除所有由本插件添加的片头片尾标记。
- 不会覆盖由原生片头探测添加的片头标记,但支持重设当前播放的集。
日志会记录所有快进、倒退、更新片头或片尾的行为,可运行以下命令实时观察。
linux
tail -f -n 30 /你自己的路径/logs/embyserver.txt | grep 'Strm Assistant:'
win
Get-Content -Path "$env:AppData\Emby-Server\programdata\logs\embyserver.txt" -Tail 30 -Wait | Where-Object { $_ -match "Strm Assistant:" }
开头无剧情的片头
2024-08-29 01:21:06.193 Info Strm Assistant: Fast-forward 10.0075647 seconds by admin.
2024-08-29 01:21:06.193 Info Strm Assistant: Last jump to time: 00:00:14.360
2024-08-29 01:21:07.815 Info Strm Assistant: Fast-forward 9.419054999999998 seconds by admin.
2024-08-29 01:21:07.815 Info Strm Assistant: Last jump to time: 00:00:25.400
2024-08-29 01:21:10.483 Info Strm Assistant: Fast-forward 9.2920818 seconds by admin.
2024-08-29 01:21:10.483 Info Strm Assistant: Last jump to time: 00:00:37.360
2024-08-29 01:21:11.630 Info Strm Assistant: Fast-forward 9.2934851 seconds by admin.
2024-08-29 01:21:11.630 Info Strm Assistant: Last jump to time: 00:00:47.800
2024-08-29 01:21:13.809 Info Strm Assistant: Fast-forward 9.2216602 seconds by admin.
2024-08-29 01:21:13.809 Info Strm Assistant: Last jump to time: 00:00:59.200
2024-08-29 01:21:19.893 Info Strm Assistant: Fast-forward 9.715739600000001 seconds by admin.
2024-08-29 01:21:19.893 Info Strm Assistant: Last jump to time: 00:01:15.000
2024-08-29 01:21:22.028 Info Strm Assistant: Fast-forward 9.745112200000001 seconds by admin.
2024-08-29 01:21:22.028 Info Strm Assistant: Last jump to time: 00:01:26.880
2024-08-29 01:21:24.160 Info Strm Assistant: Rewind -10.5717134 seconds by admin.
2024-08-29 01:21:24.160 Info Strm Assistant: Last jump to time: 00:01:18.440
2024-08-29 01:21:25.569 Info Strm Assistant: Rewind -10.6483836 seconds by admin.
2024-08-29 01:21:25.569 Info Strm Assistant: Last jump to time: 00:01:09.200
2024-08-29 01:21:29.982 Info Strm Assistant: Fast-forward 9.3867287 seconds by admin.
2024-08-29 01:21:29.982 Info Strm Assistant: Last jump to time: 00:01:23.000
2024-08-29 01:21:31.469 Info Strm Assistant: Fast-forward 9.633970499999998 seconds by admin.
2024-08-29 01:21:31.469 Info Strm Assistant: Last jump to time: 00:01:34.120
2024-08-29 01:21:34.234 Info Strm Assistant: Rewind -10.3241815 seconds by admin.
2024-08-29 01:21:34.234 Info Strm Assistant: Last jump to time: 00:01:26.560
2024-08-29 01:21:36.000 Info Strm Assistant: Fast-forward 9.5145278 seconds by admin.
2024-08-29 01:21:36.000 Info Strm Assistant: Last jump to time: 00:01:37.840
2024-08-29 01:22:29.173 Info Strm Assistant: Intro marker updated by admin for 苍兰诀 - 第 1 季 - /media/cloudnas/merged-pms-strm/tvshow/苍兰诀 (2022) {tmdb-130368}/Season 1
2024-08-29 01:22:29.173 Info Strm Assistant: Intro start time: 00:00:00.000
2024-08-29 01:22:29.173 Info Strm Assistant: Intro end time: 00:01:37.840
开头有剧情的片头
2024-09-02 11:23:30.572 Info Strm Assistant: IntroSkip - Detection Started
2024-09-02 11:24:38.418 Info Strm Assistant: Fast-forward 11.1252298 seconds by admin.
2024-09-02 11:24:38.418 Info Strm Assistant: First jump start time: 00:01:05.643
2024-09-02 11:24:38.419 Info Strm Assistant: MaxIntroDurationSeconds is extended to: 215.643 (00:03:35.643)
2024-09-02 11:24:38.419 Info Strm Assistant: Last jump to time: 00:01:17.401
2024-09-02 11:24:39.296 Info Strm Assistant: Fast-forward 9.7990642 seconds by admin.
2024-09-02 11:24:39.296 Info Strm Assistant: Last jump to time: 00:01:28.078
2024-09-02 11:24:39.864 Info Strm Assistant: Fast-forward 9.8166387 seconds by admin.
2024-09-02 11:24:39.864 Info Strm Assistant: Last jump to time: 00:01:38.463
2024-09-02 11:24:48.438 Info Strm Assistant: Fast-forward 10.7915965 seconds by admin.
2024-09-02 11:24:48.438 Info Strm Assistant: Last jump to time: 00:01:56.898
2024-09-02 11:24:48.626 Info Strm Assistant: Fast-forward 9.8635526 seconds by admin.
2024-09-02 11:24:48.626 Info Strm Assistant: Last jump to time: 00:02:06.950
2024-09-02 11:24:48.830 Info Strm Assistant: Fast-forward 9.8479945 seconds by admin.
2024-09-02 11:24:48.830 Info Strm Assistant: Last jump to time: 00:02:17.002
2024-09-02 11:24:48.996 Info Strm Assistant: Fast-forward 9.885983999999999 seconds by admin.
2024-09-02 11:24:48.996 Info Strm Assistant: Last jump to time: 00:02:27.054
2024-09-02 11:24:49.172 Info Strm Assistant: Fast-forward 9.875459900000001 seconds by admin.
2024-09-02 11:24:49.172 Info Strm Assistant: Last jump to time: 00:02:37.105
2024-09-02 11:24:50.379 Info Strm Assistant: Fast-forward 9.902405400000001 seconds by admin.
2024-09-02 11:24:50.379 Info Strm Assistant: Last jump to time: 00:02:48.200
2024-09-02 11:24:52.580 Info Strm Assistant: Fast-forward 9.854954000000001 seconds by admin.
2024-09-02 11:24:52.580 Info Strm Assistant: Last jump to time: 00:03:00.253
2024-09-02 11:24:53.833 Info Strm Assistant: Fast-forward 9.8980308 seconds by admin.
2024-09-02 11:24:53.833 Info Strm Assistant: Last jump to time: 00:03:11.390
2024-09-02 11:25:20.801 Info Strm Assistant: Intro marker updated by admin for 安娜 - 第1季 - D:\Media\tvshow\安娜 (2022) {tmdb-196268}\Season 1
2024-09-02 11:25:20.801 Info Strm Assistant: Intro start time: 00:01:05.643
2024-09-02 11:25:20.801 Info Strm Assistant: Intro end time: 00:03:11.390
片头片尾标记更新后,会在支持显示消息的客户端提示,半秒后自动消失,效果如下: