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

Get IPFS CID back from uploader and invoke RECORDING_END trigger #111

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

cyberj0g
Copy link

An ugly, but fully functional, hack to get back IPFS CID from catalyst-uploader and fire RECORDING_END trigger through log handling functions. Hope it's a good starting point to spec out a proper implementation of handling uploader output. Worst case it can be merged, if we need IPFS output tomorrow.

Catalyst issue: livepeer/catalyst#154

Important: MP4 "streaming" is not currently supported by Mist, so this is tested with FLV output.

Testing:

  1. Add autopush to mist.conf, using Pinata JWT auth token
  "autopushes": [
    [
      "test",
"ipfs://:[email protected]/out.flv"
    ]
  ],
  1. Add RECORDING_END trigger (https://webhook.site/ is a convenient service for that)
"RECORDING_END": [
  {
    "handler": "https://webhook.site/id",
    "sync": false
  }
]
  1. Push:
ffmpeg -re -i bbb/source_000.ts -c:a copy -c:v copy -f flv rtmp://localhost/live/test
  1. Get CID from callback and watch (it takes about 5 mins for gateway URL to become available)
ffplay "https://gateway.pinata.cloud/ipfs/CID?filename=out.flv" 

CC: @yondonfu @victorges

@victorges
Copy link

victorges commented Sep 28, 2022 via email

@cyberj0g
Copy link
Author

cyberj0g commented Sep 28, 2022

@victorges we need some trigger to catch CID on the caller, when upload finishes, and decided to use RECORDING_END. If autopush is configured, it will push all incoming streams which match the pattern. In other cases, it will upload to ipfs://:[email protected]/out.flv if it set as destination (MP4 not working right now), though, I'm not sure how exactly VOD works with the studio, do you have some sample curl call?

@victorges
Copy link

victorges commented Sep 28, 2022 via email

@victorges
Copy link

victorges commented Sep 28, 2022

In other cases, it will upload to ipfs://:[email protected]/out.flv

Just a reminder to use a different scheme here not to confuse this with the IPFS protocol itself. WDYT of pinata://, or even ipfs+pinata:// since the driver implementation will also not work for any other provider, only Pinata?

@cyberj0g
Copy link
Author

WDYT of pinata://, or even ipfs+pinata://

Sure, missed that, I think ipfs+pinata:// makes most sense.

@cyberj0g cyberj0g merged commit d69a61e into catalyst Oct 4, 2022
@cyberj0g cyberj0g deleted the ip/ipfs-hack branch October 4, 2022 09:19
@cyberj0g cyberj0g restored the ip/ipfs-hack branch October 4, 2022 09:19
@hjpotter92 hjpotter92 deleted the ip/ipfs-hack branch October 27, 2022 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants