bytelang / kplayer-go

A live streaming tool more suitable for non-graphical servers
https://kplayer.net
Apache License 2.0
744 stars 69 forks source link

只是想轮播图片, 就像是放PPT一样 #121

Open crazypeace opened 1 year ago

crazypeace commented 1 year ago

只是想轮播图片, 就像是放PPT一样 资源列表里面只有图片可以吗? 怎么设置每张图片的播放时长?

crazypeace commented 1 year ago

配置文件这样

version: 2.0.0
resource:
  lists:
    - unique: qfl-res
      seek: 10
      end: 20
      groups:
        - path: /home/user/pic/1.png
          media_type: video
          persistent_loop: true
        - path: /home/user/music/1.mp3
          media_type: audio
    - unique: qfl-res
      seek: 10
      end: 20
      groups:
        - path: /home/user/pic/2.png
          media_type: video
          persistent_loop: true
        - path: /home/user/music/2.mp3
          media_type: audio
    - unique: qfl-res
      seek: 10
      end: 20
      groups:
        - path: /home/user/pic/3.png
          media_type: video
          persistent_loop: true
        - path: /home/user/music/3.mp3
          media_type: audio
    - unique: qfl-res
      seek: 10
      end: 20
      groups:
        - path: /home/user/pic/4.png
          media_type: video
          persistent_loop: true
        - path: /home/user/music/4.mp3
          media_type: audio
output:
  lists:
    - path: rtmp://a.rtmp.youtube.com/live2/c1cz-4y7x-85wx-jpde-9kaa
play:
  play_model: loop
  cache_on: true
  fill_strategy: ratio
  skip_invalid_resource: true
  encode:
    video_width: 1920
    video_height: 1080

运行报错

root@fuckgfw:~/kplayer# ./kplayer play start -d

kplayer for golang v0.5.8 Copyright(c) 2019-2023 the ByteLang Studio (https://kplayer.bytelang.cn)
  libkplayer version: v1.5.4-1-ge0cab16 plugin version: 1.5.1 license version: v1 
  toolchains GNU(10.3.1) C++ Standard 17 on Linux-x86_64-6.0.2-arch1-1
  build with build-chains cmake(3.21.3) type with Release
  Hope you have a good experience.
-------------------------------------------------------------------------------------------------------------------
FATA[2023-07-23 15:59:00] start point invalid. cannot great than total resource 
vaptu commented 1 year ago

当前版本播放的资源中需要至少一个视频流和一个音频流。如果遇到播放卡顿的情况可以逐个排查是CPU编码速率跟不上了还是贷款速率跟不上。

可以尝试降低编码质量和降低比特率来观察是不是流畅

crazypeace commented 1 year ago

我找到一个 0.4.7版本的, 设置好配置文件后, 能跑起来了, 不过不能设置缩放模式, 图片就被拉伸了.

我在 0.5.8 上面已经把质量设置为1了, 还是不能用图片和音乐放. 只能先用ffmpeg合并成mp4再播放.