libcaption
libcaption copied to clipboard
Restreaming RTMP to RTMP with captions
This is not an issue, I'm just looking for help. Sorry if this is not the correct channel. I'm trying to get an input video coming from an RTMP endpoint and restreaming to another after adding srt file. I'm using a command like this one
ffmpeg -i rtmp://localhost:1935/live/test -codec copy -f flv - | ./flv+srt - ../../sub.srt - | ffmpeg -i - -codec copy -y -f flv rtmp://a.rtmp.youtube.com/live2/aabbcc
The restreaming works fine if I omit the flv+srt part, but it fails if I use the command above. The RTMP never receives the stream and this is printed in console.
Loaded new SRT at time 0.000000= 1kB time=00:00:00.00 bitrate=N/A speed= 0x
T: 0.07: [CAPTIONS CLEARED]
T: 5.40 (10.00s):41 q=-1.0 size= 1582kB time=00:00:04.86 bitrate=2665.4kbits/s speed=1.36x
This is an example of
a subtitle.
T: 15.53: [CAPTIONS CLEARED]ize= 4917kB time=00:00:15.08 bitrate=2670.7kbits/s speed=1.09x
[flv @ 0x7face391d140] Packet mismatch 216678557 6386798 6386798ate=2668.7kbits/s speed=1.07x
T: 20.40 (99.00s):2 q=-1.0 size= 6607kB time=00:00:20.18 bitrate=2682.2kbits/s speed=1.07x
This is an example of
a subtitle - 2nd subtitle.
[flv @ 0x7face391d140] Packet mismatch -527437488 5557771 11944569e=2697.8kbits/s speed=1.04x
[NULL @ 0x7facc2f05f40] missing picture in access unit with size 10178
[extract_extradata @ 0x7facd3006680] No start code is found.
pipe:: could not find codec parameters
Input #0, flv, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: aac, 44100 Hz, stereo
Stream #0:1: Video: h264, none, 1k tbn
[flv @ 0x7facd3006800] dimensions not setB time=00:00:35.98 bitrate=2694.2kbits/s speed=1.04x
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:0 -> #0:1 (copy)
Last message repeated 1 times
av_interleaved_write_frame(): Broken pipe
[flv @ 0x7fcda1304c40] Failed to update header with correct duration.
[flv @ 0x7fcda1304c40] Failed to update header with correct filesize.
Error writing trailer of pipe:: Broken pipe
frame= 1083 fps= 31 q=-1.0 Lsize= 11837kB time=00:00:36.03 bitrate=2691.3kbits/s speed=1.03x
video:11093kB audio:704kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.343468%
Error closing file pipe:: Broken pipe
Conversion failed!
Do you have any idea about what the cause can be?
I'm realising this is maybe a duplicate of #55 but that issue has no answer yet