System of profiles
What is profile?
Section titled “What is profile?”A Profile is an entity in senta-streamer, which represents a command to run the ffmpeg program, where parameters such as input and output streams, as well as other user-defined parameters, are replaced with variables.
Example:
ffmpeg -re -stream_loop -1 -i input.ts -vcodec mpeg4 -aspect 16:9 -f mpegts udp://bla-bla:1234This example starts a UDP stream with static broadcasting of the file input.ts to the address udp://bla-bla:1234.
Suppose we want to use senta-streamer to broadcast a static file. We can simply add a line to the profiles, or we can replace the input and output streams with variables (${i} and ${o} respectively), resulting in a universal transcoding profile that can be scaled to other streams. As a result, we get:
ffmpeg -re -stream_loop -1 -i ${i} -vcodec mpeg4 -aspect 16:9 -f mpegts ${o}Profile structure
Section titled “Profile structure”In addition to the usual profile with standard variables such as ${i} and ${o} you can add some extensions for your profile.
You can set profile NAME. This name will be use when you, for example, load profile to github. It is optional field
Example:
ffmpeg -y -hide_banner -i ${i} -map 0:0 -map 0:1 -c:v h264_nvenc -preset fast -profile:v main -filter:v yadif -forced-idr 1 -b:v 4M -c:a aac -b:a 128k -r 25 -g 8 -keyint_min 13 -f mpegts ${o}NAME "HD h264"Next, you can add custom variables after keyword WHERE
Example
# Simple startup profile for HD h264 encoding# You can change it, fork it and share it with othersffmpeg -y -hide_banner -i ${i} -map 0:0 -map 0:1 -c:v h264_nvenc ${gpu} -preset fast -profile:v main -filter:v yadif -forced-idr 1 -b:v 4M -c:a aac -b:a 128k -r 25 -g 8 -keyint_min 13 -f mpegts ${o}NAME "HD h264"WHERE[ { "desc": "gpu", "data": { "name": "GPU", "description": "Select GPU which stream will use, set empty if you don't use GPU", "command": "-gpu $value", "default": "" } }]Note: you can add comments strings to your profile with start with //
Profiles Repository
Section titled “Profiles Repository”You can find ready-made profiles in the repository: https://github.com/cesbo/senta-streamer-profiles
How to add or modify a profile
Section titled “How to add or modify a profile”To add your profile or make changes to an existing one:
-
Fork the repository : Go to https://github.com/cesbo/senta-streamer-profiles and click on the “Fork” button in the top right corner of the page. This will create a copy of the repository in your GitHub account.
-
Clone your fork : Open your terminal (or Git Bash on Windows) and execute the command
git clone https://github.com/your_username/senta-streamer-profiles, replacing “your_username” with your GitHub username. -
Create a new branch : Navigate into the cloned repository using the command
cd senta-streamer-profiles, then create a new branch usinggit checkout -b add_profile, where “add_profile” is the name of your branch. -
Add your file : Place your profile file into the /profiles directory in the cloned repository.
-
Add the file to staging and commit : Execute the following commands in your terminal:
Terminal window git add profiles/your_file_namegit commit -m "Added profile: %your_file_name%"Replace “your_file_name” with the name of your file.
-
Push your changes to your GitHub repository : Execute the command
git push origin add_profile, where “add_profile” is the name of your branch. -
Open a Pull Request (PR) : After pushing your changes, go to your forked repository’s page on GitHub. There you should see a “Compare & pull request” button for your new branch. Click on it.
-
Create a Pull Request : Review the changes you want to make, ensure everything is correct, and then click on the “Create pull request” button.
-
Wait for review and merge : Other contributors to the project may review your Pull Request, leave comments, or request changes. Once your PR is reviewed and approved, one of the project maintainers will merge your branch into the main branch.
That’s it! Your profile file should now be added to the public repository.