Giter Site home page Giter Site logo

Comments (4)

gabek avatar gabek commented on June 3, 2024

There's not really a concept of "file names". I'm sure there could be a way to embed the file name into the RTMP metadata, but Owncast wouldn't do anything with that.

The solution would be to use the Owncast API to set the stream title each time you change files on the broadcasting side. How you'd detect the file change is something you'd need to figure out with ffmpeg, however.

Here's the API you'd want to use. It requires an access token. https://owncast.online/api/latest/#tag/Integrations/paths/~1api~1integrations~1streamtitle/post

from owncast.

tokenwizard avatar tokenwizard commented on June 3, 2024

Ok, thanks for that. I think I can make that work.
Looking at the API docs, it looks like I need this application/json format and the "value" key. I've tried POSTing this to my server but I get "unauthorized" response.

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <<access token>>" -d '{"value": "Testing Stream Title!"}' http://192.168.12.50:8080/api/integrations/streamtitle

UPDATE: I figured it out. I had to create an access token that had admin access. All good now. Thanks!

from owncast.

tokenwizard avatar tokenwizard commented on June 3, 2024

For anyone who might stumble on this an want to know my solution. I am just using a for loop to first set the Stream Title to the filename and then send the file via ffmpeg. This will cycle through each mkv file in the current folder and stream it in turn, first setting the Stream Title.

#!/bin/bash
# set the file extension of your media
file_ext='mkv'

# set your server IP and Port
server_ip=<your_ip>
server_port=<your_port>
rtmp_port=<your_rtmp_port>

# set your stream key
stream_key='<your_stream_key>'

# iterate through each media file and replace spaces with underscores for the Stream Title (NOTE: change <your_access_token> to yours that you created)
for file in *.${file_ext}; do 
        title=$(echo $file | tr ' ' '_'); 
        curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <your_access_token>" -d '{"value": "'$title'"}' http://${server_ip}:${server_port}/api/integrations/streamtitle; ffmpeg -re -i "$file" -c:v copy -c:a copy -f flv rtmp://${server_ip}:${rtmp_port}/live/"$stream_key";
done

from owncast.

gabek avatar gabek commented on June 3, 2024

Very cool!

from owncast.

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.