Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ie/vimeo] Extract "live_status" and "release_timestamp" for live events #9290

Merged
merged 3 commits into from Mar 2, 2024

Conversation

pzhlkj6612
Copy link
Contributor

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Note: this is a quick fix. I didn't do thorough testing.


The config['video']['live_event'] field is:

// is_upcoming

{
  "video": {
    "live_event": {
      "id": "",
      "status": "pending",
      "show_viewer_count": false,
      "settings": {
        "event_schedule": true,
        "hide_live_label": false
      },
      "archive": {
        "status": "",
        "source_url": ""
      },
      "ingest": {
        "scheduled_start_time": "2023-02-29T00:00:00+00:00",
        "width": 0,
        "height": 0,
        "start_time": 0
      },
      "low_latency": false,
      "dvr": false,
      "sessionUrl": null
    }
  }
}

// is_live

{
  "video": {
    "live_event": {
      "id": "00000000-0000-0000-0000-000000000000",
      "status": "started",
      "show_viewer_count": false,
      "settings": {
        "event_schedule": true,
        "hide_live_label": false
      },
      "archive": {
        "status": "started",
        "source_url": ""
      },
      "ingest": {
        "scheduled_start_time": "2023-02-29T00:00:00+00:00",
        "width": 1920,
        "height": 1080,
        "start_time": 1700000000
      },
      "low_latency": false,
      "dvr": false,
      "sessionUrl": "https://live-api.vimeocdn.com/sessions/${video.live_event.id}?~exp=1700000000&~id=player&~sig=..."
    }
  }
}

// was_live

{
  "video": {
    "live_event": null
  }
}

For now, our code can't differentiate between "was_live" and "not_live", or say, between "live archives" and "fixed-length videos".


Those four statuses are from https://f.vimeocdn.com/p/4.28.9/js/player.module.js (wayback machine backup).

{e.pending="pending",e.active="active",e.started="started",e.ended="ended"}

For future developers

We should get info about live videos by analyzing https://vimeo.com/live_event/status?clip_id=${video_id} . This API is still informative after the end of live events.

// is_upcoming

{
  "id": 42,
  "metering": {
    "seconds_remaining": 43200,
    "seconds_max": 43200
  },
  "ingest": {
    "rtmps_url": "rtmps://rtmp-global.cloud.vimeo.com:443/live",
    "height": null,
    "width": null,
    "status": 0,
    "session_id": null,
    "stream_ended_reason": null,
    "start_time": null,
    "scheduled_start_time": "2023-02-29T00:00:00+00:00"
  },
  "archive": {
    "status": 0
  }
}

// is_live

{
  "id": 42,
  "metering": {
    "seconds_remaining": 40000,
    "seconds_max": 43200
  },
  "ingest": {
    "rtmps_url": "rtmps://rtmp-global.cloud.vimeo.com:443/live",
    "height": 1080,
    "width": 1920,
    "status": 4,
    "session_id": "00000000-0000-0000-0000-000000000000",
    "stream_ended_reason": null,
    "start_time": 1700000000,
    "scheduled_start_time": "2023-02-29T00:00:00+00:00"
  },
  "archive": {
    "status": 1
  }
}

// was_live

{
  "id": 42,
  "metering": {
    "seconds_remaining": 43200,
    "seconds_max": 43200
  },
  "ingest": {
    "rtmps_url": "rtmps://rtmp-global.cloud.vimeo.com:443/live",
    "height": 1080,
    "width": 1920,
    "status": 5,
    "session_id": "00000000-0000-0000-0000-000000000000",
    "stream_ended_reason": 6,
    "start_time": 1700000000,
    "scheduled_start_time": "2023-02-29T00:00:00+00:00"
  },
  "archive": {
    "status": 2
  }
}
Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

@seproDev seproDev added the site-enhancement Feature request for some website label Feb 25, 2024
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
@pzhlkj6612
Copy link
Contributor Author

I tested Vimeo's public events with FFmpeg RTMP.

What I did live_event::status Found streams Audiences saw The host's management page
Created an event pending HTTP 404 a placeholder [1] "Go live from your encoder to start the event"
Started live by launching FFmpeg started live the live stream showing the preview
Killed FFmpeg live but no new segments "Live stream offline" the preview turned blank
Waited a moment [2] live_event is None VOD the archived video "{event_name} has stopped streaming"

With "Preview stream before going live" [3] enabled:

What I did live_event::status Found streams Audiences saw The host's management page
Created an event pending HTTP 404 a placeholder [1] "Connect encoder to begin stream preview"
Launched FFmpeg active showing the preview
Killed FFmpeg
Waited a moment [2] pending "Stream preview ended due to inactivity. Restart the stream from your encoder to resume."
Relaunched FFmpeg and clicked "Go live" started live the live stream showing the preview
Killed FFmpeg live but no new segments "Live stream offline" the preview turned blank
Waited a moment [2] live_event is None VOD the archived video "{event_name} has stopped streaming"

.

So, the live_status of "active" should be "is_upcoming".

@bashonly bashonly self-assigned this Mar 1, 2024
@bashonly bashonly merged commit f0426e9 into yt-dlp:master Mar 2, 2024
6 checks passed
@pzhlkj6612 pzhlkj6612 deleted the vimeo/live_start_desu branch March 2, 2024 00:42
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants