Zibbp / ganymede

Twitch VOD and Live Stream archiving platform. Includes a rendered and real-time chat for each archive.
https://github.com/Zibbp/ganymede
GNU General Public License v3.0
491 stars 25 forks source link

Player and chat issues #491

Closed rapyyy closed 2 months ago

rapyyy commented 2 months ago

Hello everyone :),

I recently installed the Ganymede stack and it's working perfectly. However, I have a small issue with the player. Indeed, the video (VOD) takes several minutes to start and afterwards it is impossible to advance or rewind. If I try to fast forward or rewind, the video always goes back to the beginning. Similarly, the chat never appears.

However, the VOD and the chat are properly recorded and I can watch them through the files for example.

The problem is widespread but if you have any ideas, I'm open to them :)

Thank you !

Zibbp commented 2 months ago

Couple of questions:

rapyyy commented 2 months ago

Hey Zibbp,

Thanks for your answer.

  "format": {
    "bit_rate": "6263561",
    "duration": "2179.185000",
    "filename": "/data/videos/yann/2024-08-22-40987058613-live-5d016714-60b7-11ef-8edc-0242ac190005/40987058613-video.mp4",
    "format_long_name": "QuickTime / MOV",
    "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
    "nb_programs": 0,
    "nb_streams": 2,
    "probe_score": 100,
    "size": "1706182514",
    "start_time": "0.000000",
    "tags": {
      "compatible_brands": "isomiso2avc1mp41",
      "encoder": "Lavf59.27.100",
      "major_brand": "isom",
      "minor_version": "512"
    }
  },
  "streams": [
    {
      "avg_frame_rate": "65298000/1089593",
      "bit_rate": "6000047",
      "bits_per_raw_sample": "8",
      "chroma_location": "left",
      "closed_captions": 0,
      "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
      "codec_name": "h264",
      "codec_tag": "0x31637661",
      "codec_tag_string": "avc1",
      "codec_type": "video",
      "coded_height": 1080,
      "coded_width": 1920,
      "disposition": {
        "attached_pic": 0,
        "captions": 0,
        "clean_effects": 0,
        "comment": 0,
        "default": 1,
        "dependent": 0,
        "descriptions": 0,
        "dub": 0,
        "forced": 0,
        "hearing_impaired": 0,
        "karaoke": 0,
        "lyrics": 0,
        "metadata": 0,
        "original": 0,
        "still_image": 0,
        "timed_thumbnails": 0,
        "visual_impaired": 0
      },
      "duration": "2179.185000",
      "duration_ts": 196126650,
      "extradata_size": 40,
      "field_order": "progressive",
      "film_grain": 0,
      "has_b_frames": 2,
      "height": 1080,
      "id": "0x1",
      "index": 0,
      "is_avc": "true",
      "level": 40,
      "nal_length_size": "4",
      "nb_frames": "130596",
      "pix_fmt": "yuv420p",
      "profile": "Main",
      "r_frame_rate": "30/1",
      "refs": 1,
      "start_pts": 0,
      "start_time": "0.000000",
      "tags": {
        "handler_name": "VideoHandler",
        "language": "und",
        "vendor_id": "[0][0][0][0]"
      },
      "time_base": "1/90000",
      "width": 1920
    },
    {
      "avg_frame_rate": "0/0",
      "bit_rate": "249455",
      "bits_per_sample": 0,
      "channel_layout": "stereo",
      "channels": 2,
      "codec_long_name": "AAC (Advanced Audio Coding)",
      "codec_name": "aac",
      "codec_tag": "0x6134706d",
      "codec_tag_string": "mp4a",
      "codec_type": "audio",
      "disposition": {
        "attached_pic": 0,
        "captions": 0,
        "clean_effects": 0,
        "comment": 0,
        "default": 1,
        "dependent": 0,
        "descriptions": 0,
        "dub": 0,
        "forced": 0,
        "hearing_impaired": 0,
        "karaoke": 0,
        "lyrics": 0,
        "metadata": 0,
        "original": 0,
        "still_image": 0,
        "timed_thumbnails": 0,
        "visual_impaired": 0
      },
      "duration": "2179.114667",
      "duration_ts": 104597504,
      "extradata_size": 2,
      "id": "0x2",
      "index": 1,
      "nb_frames": "102146",
      "profile": "LC",
      "r_frame_rate": "0/0",
      "sample_fmt": "fltp",
      "sample_rate": "48000",
      "start_pts": 240,
      "start_time": "0.005000",
      "tags": {
        "handler_name": "SoundHandler",
        "language": "und",
        "vendor_id": "[0][0][0][0]"
      },
      "time_base": "1/48000"
    }
  ]
}
Zibbp commented 2 months ago

Loading large mp4 files over a remote connection (non lan network) can be slow. MP4 doesn't have any chunking and often requires downloading a large portion of it to start playing. There's a setting in Admin > Settings called "Convert to HLS". This will convert downloaded videos to HLS which basically is a fragmented MP4 that loads a lot quicker over slow remote connections. Can you enable that and try archiving another VOD? It will not retroactively apply, you need to archive something new. Once it's archived check if it loads any faster.

rapyyy commented 2 months ago

Hello ! Sorry for the delay.

In fact, with HLS activated, all is alright now. The VODs and chat are loaded and so much faster !

Sorry for bothering you with this and thank you very much for the details.

Excellent work again :)