Skip to content

Multiple Captures on Single Interface #90

@PreDeToR

Description

@PreDeToR

Hi Guys

I am running into a bit of a problem, and I hope someone can help me out a bit or point me in the right direction.

Currently, I run bmdcapture which I then feed into ffmpeg/avconf to make a local copy of the feed and rtmp stream it to my remote servers. However I run into a issue sometimes when the connection to the servers drop the local file gets corrupted which means I cant use the file to retrieve the missed content.

Current Command (I know I am using FFMPEG, perfectly 99% of the time):
/root/bmdtools/bmdcapture -C 4 -m 1 -A 2 -V 4 -M 5 -F nut -d 1 -v -f pipe:1 | /root/ffmpeg_sources/ffmpeg/ffmpeg -loglevel error -i pipe:0 -t 43200 -map_channel 0.1.0 -c:a mp3 -strict -2 -ac 2 -ar 44100 -ab 128k -af "volume=4" -deinterlace -pix_fmt yuv420p -vcodec libx264 -preset slow -coder 1 -bf 3 -x264opts nal-hrd=none -g 50 -b:v 3500k -bufsize 5500k -f flv 'rtmp://xxx/xxx/xxx'

What I want to do is:
1)run bmdcapture into a file or something (20-30 seconds backlog/buffer).
2)run a separate process to read this file and make a local backup. (for important streams that I need backups to in case the stream goes down)
3)run another process to then read the file from 1 and push that to my streaming servers.
4)possibly run another process to then read the file from 1 and push that to streaming servers using same of different flags(different audio mapping etc).

I thought of a FIFO/pipe but that only allows me one reading process.
I also tried capturing in hls format (-f hls -hls_time 1 -hls_wrap 50 -hls_list_size 10) but then when 3 reads it and I stream it up I get this strange "hiccup" in the audio every 2 seconds or so.

Commands I used:
/root/bmdtools/bmdcapture -C 4 -m 1 -A 2 -V 4 -M 2 -F nut -d 1 -v -f pipe:1 | /root/ffmpeg_sources/ffmpeg/ffmpeg -loglevel error -i pipe:0 -y -c:a mp3 -strict -2 -ac 2 -ar 44100 -ab 128k -deinterlace -pix_fmt yuv420p -vcodec libx264 -preset slow -coder 1 -bf 3 -x264opts nal-hrd=none -g 50 -b:v 3500k -bufsize 5500k -f hls -hls_time 1 -hls_wrap 50 -hls_list_size 10 -hls_segment_filename "/root/Streams/178F9BF0B9BA9DB813328A63F4A0F0A5-hls-%05d.ts" "/root/Streams/178F9BF0B9BA9DB813328A63F4A0F0A5-hls.m3u8"

/root/ffmpeg_sources/ffmpeg/ffmpeg -loglevel info -i "/root/Streams/178F9BF0B9BA9DB813328A63F4A0F0A5-hls.m3u8" -t 43200 -map_channel 0.1.0 -c:a mp3 -strict -2 -ac 2 -ar 44100 -ab 128k -af "volume=4" -pix_fmt yuv420p -vcodec libx264 -preset slow -coder 1 -bf 3 -x264opts nal-hrd=none -g 50 -b:v 3500k -bufsize 5500k -f flv 'rtmp://xxx/xxx/xxx'

So basically I want to grab the input from SDI, capture it on the machine locally with a small buffer, and then have 1 or more processes read from this local "buffer" to do other things with the stream.

Any Ideas, suggestions would be greatly appreciated.

Regards
Danie


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions