Giter Club home page Giter Club logo

Comments (8)

KNaiFen avatar KNaiFen commented on May 27, 2024 1

这个是streamlink的自动去除广告的内容,因为不录广告,twitch就会一直重复给,导致你少拿了后面十多秒的内容,我开了会员,用会员cookie就没这个问题了,当然可以在下载器里边把去广告功能关了就行了,我这两天看看给这个功能加个开关= =

from biliup.

KNaiFen avatar KNaiFen commented on May 27, 2024 1

最新的KNaiFen分支的源码里解决了,增加了去广告的开关,你可以选择不分段但是录进去广告,配置文件里默认开启
PIP的安装版本,要等到发下个版本的时候才会加进去

from biliup.

KNaiFen avatar KNaiFen commented on May 27, 2024

这种四五个很短的7M左右的,里边确定不是广告吗?你点开来看应该是twitch的紫色标志啥的吧

from biliup.

HADB avatar HADB commented on May 27, 2024

刚才看了并不是,是主播的视频,被裁剪成几秒钟的片段了。过滤之后,大文件之间不连续,有遗漏

from biliup.

HADB avatar HADB commented on May 27, 2024

刚才这些上传时被过滤清除掉了,下次我保留一下,看看视频参数是不是不一样

from biliup.

HADB avatar HADB commented on May 27, 2024

看了下容器的完整日志,看到 skip ad segments 的输出了,里面也有 Connection timed outInterrupted! Exiting 的错误,不知道有没有影响。其他几个小片段也是一样重复的内容。

刚才又录了一段,对比了一下大片段和小片段,发现大片段最后的时间轴与下一个小片段之间丢了22秒左右,每个小片段持续时长正好都是10秒,每个小片段之间也是不连续的,也有丢失(可通过文件名时间+10s和下一段文件名比较)

以下4个视频是连续的4个小片段:

ForGG_20230605_134913.part-000.mp4
ForGG_20230605_134946.part-000.mp4
ForGG_20230605_135020.part-000.mp4
ForGG_20230605_135118.part-000.mp4

容器日志:

[plugins.twitch][info] Will skip ad segments
Input #0, mpegts, from 'http://localhost:47830':
  Duration: N/A, start: 27328.032000, bitrate: N/A
�������
  Program 1 
    Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 162 kb/s
    Stream #0:1[0x101]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 90k tbn, 120 tbc
    Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
[segment @ 0x556460e9aec0] Opening 'ForGG_20230605_131953 part-000.mp4' for writing
Output #0, segment, to 'ForGG_20230605_131953 part-%03d.mp4':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 60 tbr, 15360 tbn, 60 tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 162 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[stream.hls][info] Filtering out segments and pausing stream output
frame=  360 fps= 79 q=-1.0 size=N/A time=00:00:05.99 bitrate=N/A speed=1.32x    
frame=  600 fps= 24 q=-1.0 size=N/A time=00:00:09.99 bitrate=N/A speed= 0.4x    
http://localhost:47830: Connection timed out
frame=  600 fps= 24 q=-1.0 Lsize=N/A time=00:00:09.99 bitrate=N/A speed= 0.4x    
video:7398kB audio:196kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
download.py163[INFO]Tname:Asynchronous1_1 Nonepart: ForGG_20230605_131953.mp4
download.py205[INFO]Tname:Asynchronous1_1 FileNotFoundError:ForGG_20230605_131953.mp4
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
[cli][info] streamlink is running as root! Be careful!
[cli][info] Found matching plugin twitch for URL https://www.twitch.tv/forgg
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:25196/
[cli][info]  http://172.17.0.15:25196/
ffmpeg version 4.3.6-0+deb11u1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
�������
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[cli][info] Got HTTP request from Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
[cli][info] Opening stream: 1080p60 (hls)

from biliup.

xxxxuanran avatar xxxxuanran commented on May 27, 2024

#434
也许与该问题有相似之处。试试自己写参数,用你定义的下载器去下载试试呢?

from biliup.

HADB avatar HADB commented on May 27, 2024

我之前 downloader 用的 ffmpeg 有这个问题,我昨晚换成 streamlink 好像没发现这个分段问题。

我看了下代码,这个地方的判断是 downloader == 'ffmpeg',是不是这里应该是 streamlink

if self.downloader == 'ffmpeg':
port = random.randint(1025, 65535)
stream_shell = [
"streamlink",
"--player-external-http", # 为外部程序提供流媒体数据
# "--twitch-disable-ads", # 去广告,去掉、跳过嵌入的广告流
# "--twitch-disable-hosting", # 该参数从5.0起已被禁用
"--twitch-disable-reruns", # 如果该频道正在重放回放,不打开流
"--player-external-http-port", str(port), # 对外部输出流的端口
self.url, "best" # 流链接
]
if self.twitch_disable_ads: # 去广告,去掉、跳过嵌入的广告流
stream_shell.insert(1, "--twitch-disable-ads")
twitch_cookie = config.get('user', {}).get('twitch_cookie')
if twitch_cookie:
twitch_cookie = "--twitch-api-header=Authorization=OAuth " + twitch_cookie
stream_shell.insert(1, twitch_cookie)
self.proc = subprocess.Popen(stream_shell)
self.raw_stream_url = f"http://localhost:{port}"
i = 0
while i < 5:
if not (self.proc.poll() is None):
return
time.sleep(1)
i += 1
return True

from biliup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.