How to directly stream HLS to MediaStore from Raspberry Pi & ffmpeg

0

Hi,

I'm trying to stream HLS on a Raspberry Pi 4 via ffmpeg directly to MediaStore, without using MediaLive. At least, I've confirmed that Camstreamer can skip MediaLive and directly stream to MediaStore.

My question:

  1. How can I directly stream HLS to MediaStore?
  2. Should I use PutObject API to write to MediaStore? (Only way?)
  3. How can I continuously do PutObject for HLS files (.ts files) that are generated continuously?

This question seems to be related below and helped me a lot, but this didn't answer my above whole questions.

Using Wowza Streaming Engine with MediaStore
https://forums.aws.amazon.com/thread.jspa?threadID=330312&tstart=0

Sample ffmpeg HLS generation (success)
ffmpeg -f v4l2 -thread_queue_size 16384 -s 1920x1080 -vsync -1 -i /dev/video0 \
-c:v libx264 -b:v 1000k -bufsize 1000k \
-flags _cgop_loop-global_header \
-bsf:v h264_mp4toannexb \
-f segment -segment_format mpegts -segment_time 10 -segment_list live/channel.m3u8 live/segment%03d.ts

Thank you in advance for your help.

asked 3 years ago500 views
2 Answers
0

Hi KiyoKiyo!

It sounds like you're looking for the simplest way to get the result of your ffmpeg transcode onto MediaStore. I can think of a few paths for you. Normally an encoder would be responsible for flinging segments as they're generated. For you, I think some assembly will be required. But, in a nutshell, you just treat it like S3. As your segments and manifests are created, either use the aws cli or your own custom code to move them one at a time into MediaStore.

You will have the full set of MediaStore commands available to you via the AWS CLI. Make sure that you configure an IAM user with the appropriate permissions and take note of their access key and secret access key.

Another path would be to use the Botocore SDK for whatever your preferred programming language is. I suspect that on your Pi this will be the better way to go, as you will likely have to code your own solution for checking for new segments and manifests appearing and moving them into MediaStore as soon as possible.

Let me know if I've understood your question properly and I'll be happy to provide any other clarifications.

Nate

AWS
answered 3 years ago
0

Hi Nate,

Thank you for your answer! I see, I'll treat MediaStore like S3 with AWS CLI, just keep putting ts files generated. Also look into Botocore SDK too for simplicity.

You helped so much!

Kiyokiyo

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions