AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.77k stars 307 forks source link

How to overlay http subtitle stream on http AV stream #932

Open s60sc opened 4 months ago

s60sc commented 4 months ago

Given the yaml file below, how to overlay a subtitle stream in SRT format from http://192.168.1.135/sustain?srt=3 Thanks

streams:

  CAM:
    - ffmpeg:http://192.168.1.135/sustain?stream=1#video=h264
    - ffmpeg:http://192.168.1.135/sustain?audio=2#audio=opus
AlexxIT commented 4 months ago

SRT not supported. What you are viewing? Is it usual TV?

s60sc commented 4 months ago

Streams generated by an ESP32, viewed on the go2rtc built in player for testing. ChatGPT indicates ffmpeg can combine SRT and video eg ffmpeg -i http://path_to_video_stream -i http://path_to_subtitle_stream -c:v copy -c:a copy -c:s mov_text but how to incorporate this into the yaml file if possible. Thanks.

AlexxIT commented 4 months ago

What is inside your SRT? Is it some real time information?

s60sc commented 4 months ago

At this stage just a series of timestamps

1
00:00:00 --> 00:00:01
17:58:52

2
00:00:01 --> 00:00:02
17:58:53

would something like: - exec:ffmpeg -i http://192.168.1.135/sustain?stream=1 -i http://192.168.1.135/sustain?srt=3 -c:v copy -c:a copy -c:s mov_text

be in the right direction, but how to direct it to the go2rtc player as a h264 stream

AlexxIT commented 4 months ago

Once again. For now go2rtc doesn't support any subtitles. Because I haven't seen any point to support them for real time tasks. I thought you were going to tell me some interesting reason to support them. But so far, I don't see one :)

s60sc commented 4 months ago

Fair enough, thanks for your time. Actually it would have been useful for treal time sensor telemetry data,

AlexxIT commented 4 months ago

I haven't see useful software, that can generate subtitles in real time. For example voice recognition. Or even telemetry data from some sensors.

s60sc commented 4 months ago

My esp32s3 app can generate real time telemetry data which it currently stores as an srt file along with an avi file which can be played back together with eg VLC. A user suggested adding streaming audio and referenced your app, and outputting an srt stream as well is straightforward

rjsachse commented 3 months ago

This would be a great feature 👍

AlexxIT commented 1 month ago

That's a pretty big task. Need to add a new entity - text. I'll hold off until a better time.