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

Live captioning: need help #55

Open
nitsuj102284 opened this issue Feb 12, 2019 · 5 comments
Open

Live captioning: need help #55

nitsuj102284 opened this issue Feb 12, 2019 · 5 comments

Comments

@nitsuj102284
Copy link

My goal is to update a .srt file through a web form for live streaming captioning. Our output is HLS + Facebook and YouTube. Nginx RTMP converts the stream to HLS, but for my test, I bypassed HLS and tested output of RTMP stream back into Nginx RTMP.

My test was:
Streaming encoder --> Nginx RTMP --> FFMPEG/FLV+SRT --> Nginx RTMP

I tried the example, noticing the paragraph regarding live captioning.

Here is my command:
ffmpeg -i rtmp://streamserver.tld:1936/publish/999 -codec copy -f flv - | flv+srt - ~/libcaption/cc.srt - | ffmpeg -i - -codec copy rtmp://streamserver.tld:1936/rtmp/999_cc

I tried two srt files, because I was unsure of the exact format:

cc.srt:
1
00:00:00,000 --> 00:00:00,000
Test live cc text
\0

cc2.srt:
1
\0
00:00:00,000 --> 00:00:00,000
Test live cc text

Received pretty big output in CLI, including:
Reading flv from -
Reading captons from /home/streambright/libcaption/cc.srt
Writing flv to -
*** buffer overflow detected ***: flv+srt terminated

...

and

...

pipe:: Invalid data found when processing input

Any help on what I am not getting is appreciated. Thanks!

@curtgrimes
Copy link

Are both the captions and video going to be live, changing and not predetermined? If so, I'm trying to also figure out right now how to accomplish this. This comment outlines a possible solution: #17 (comment)

@nitsuj102284
Copy link
Author

Yes, exactly. My first test was to create the captions file and then, if that worked, update the file to see if it updates on the video output.

I saw that comment, and tried to make sense of it. Also, there is a paragraph about it at the bottom of the 'examples' Readme. That comment and the paragraph in the Readme seemed to be contradictory about where to put the null character.

Can you post the command/caption file that you have tried, and if you have had any success or different errors?

@curtgrimes
Copy link

I think you're still a few steps ahead of me at the moment in figuring this out. I haven't tried anything yet, but let me get back to you when I'm able to make some progress.

@curtgrimes
Copy link

curtgrimes commented Feb 16, 2019

@nitsuj102284 Would you like to message me to talk about this? https://m.me/curtgrimes

@KPAXIT
Copy link

KPAXIT commented Aug 28, 2019

Hi there.
I would like to share some of my findings regarding the 'broken' output from flv+srt when you use pipe eg '-' instead of file.

As a TS my goal is also to inject CC in the livestream. I only use Gstreamer instead of ffmpeg.
I was able to generate input data with gstreamer(h264 video wraped in flv) pass it to flv+srt and save to a file successfully.
gst-launch-1.0 videotestsrc ! ...etc ... ! flvmux ! fdsink | flv+srt - mysrtfile.srt output_with_cc.flv

The problem was when I was trying to pass output from flv+srt further to the next process (ffmpeg or gstreamer) for re-sending the result data to streaming server. I was able to capture this (broken) output to a file and compare it with working output created by flv+srt eg 'output_with_cc.flv' and there where a bunch of added lines with 'Matches: 2 Start pts: 4.271000' etc.
Those are produced by vtt.c (line 164 and 168) uncommenting this lines has helped to resolve this issue for now.

I assume this lines should not be printed when using pipe and it's bug.

Good luck.

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

No branches or pull requests

3 participants