diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index bb03931..438d50a 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -31,7 +31,7 @@ msgstr "Stream der als Quelle für die Weiterleitung verwendet wird" #: restream/models.py:12 msgid "restreamconfig_target_help" -msgstr "RTMP Ziel URL an die der Stream weitergeleitet wird" +msgstr "Ziel URL an die der Stream weitergeleitet wird, inklusive Schema (z.B. rtmp://)" #: restream/models.py:13 msgid "restreamconfig_name_help" diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index f85a599..ff70da8 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -31,7 +31,7 @@ msgstr "Stream that's being used as source for the restreaming" #: restream/models.py:12 msgid "restreamconfig_target_help" -msgstr "RTMP target url that the stream is being restreamed to" +msgstr "Target url that the stream is being restreamed to, including schema (e.g. rtmp://)" #: restream/models.py:13 msgid "restreamconfig_name_help" diff --git a/restream/admin.py b/restream/admin.py index ef945a4..3070e29 100644 --- a/restream/admin.py +++ b/restream/admin.py @@ -4,7 +4,7 @@ from .models import RestreamConfig class RestreamConfigAdmin(GuardedModelAdmin): - fields = ['name', 'active', 'stream', 'target'] + fields = ['name', 'active', 'stream', 'format', 'target'] admin.site.register(RestreamConfig, RestreamConfigAdmin) diff --git a/restream/forms.py b/restream/forms.py index 7497e5d..5e36557 100644 --- a/restream/forms.py +++ b/restream/forms.py @@ -6,7 +6,7 @@ from . import models class RestreamConfigFilteredStreamForm(ModelForm): class Meta: model = models.RestreamConfig - fields = ['name', 'stream', 'target', 'active'] + fields = ['name', 'stream', 'target', 'format', 'active'] def __init__(self, *args, **kwargs): user = kwargs.pop('user', None) diff --git a/restream/migrations/0003_restreamconfig_format.py b/restream/migrations/0003_restreamconfig_format.py new file mode 100644 index 0000000..79d648a --- /dev/null +++ b/restream/migrations/0003_restreamconfig_format.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2021-12-14 17:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('restream', '0002_auto_20200501_1302'), + ] + + operations = [ + migrations.AddField( + model_name='restreamconfig', + name='format', + field=models.CharField(choices=[('flv', 'flv (RTMP)'), ('mpegts', 'mpegts (SRT)')], default='flv', help_text='restreamconfig_format_help', max_length=6), + ), + ] diff --git a/restream/models.py b/restream/models.py index 3f20fa2..6efe4e0 100644 --- a/restream/models.py +++ b/restream/models.py @@ -9,10 +9,15 @@ from rtmp.models import Stream class RestreamConfig(models.Model): + FORMATS = ( + ('flv', 'flv (RTMP)'), + ('mpegts', 'mpegts (SRT)'), + ) stream = models.ForeignKey(Stream, on_delete=models.CASCADE, help_text=_('restreamconfig_stream_help')) target = models.CharField(max_length=500, help_text=_('restreamconfig_target_help')) name = models.CharField(max_length=100, help_text=_('restreamconfig_name_help')) active = models.BooleanField(help_text=_('restreamconfig_activate_help')) + format = models.CharField(max_length=6, choices=FORMATS, default='flv', help_text=_('restreamconfig_format_help')) class Meta: verbose_name = _('restreamconfig_verbose_name') @@ -32,7 +37,8 @@ class RestreamConfig(models.Model): 'name': self.name, 'app': self.stream.application.name, 'stream': str(self.stream.stream), - 'target': self.target + 'target': self.target, + 'format': self.format } return json.dumps(config) diff --git a/rtmp/templates/rtmp/stream_detail.html b/rtmp/templates/rtmp/stream_detail.html index 9d93ff0..0e6ef44 100644 --- a/rtmp/templates/rtmp/stream_detail.html +++ b/rtmp/templates/rtmp/stream_detail.html @@ -33,7 +33,7 @@
{% trans "how_to_configure_your_encoder_header" %}

{% trans "set_this_stream_server_in_encoder" %}

-

rtmp://TODO TODO SERVER BASE URL/{{ object.application }}/

+

rtmp://ingest.chaoswest.tv:1935/{{ object.application }}/

{% trans "set_this_stream_id_in_encoder" %}