Uploading output of ffmpeg to AWS S3

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Uploading output of ffmpeg to AWS S3

Tarun singhal
Hi Folks,


I am trying following windows command


ffmpeg -i <M3u8 Stream> -an -r 2 -t 60 -f image2 -vcodec mjpeg
pipe:a_%0d.jpg | aws s3 cp - s3://ffmpegbucket-1/


The objective is read a live stream keep generating frames and as soon I
get 1st frame transfer it to AWS S3 bucket. So this will be continous
upload process


But this command is not working.


Can you please help?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Uploading output of ffmpeg to AWS S3

Moritz Barsnick
On Thu, Jun 07, 2018 at 17:39:06 +0530, tarun singhal wrote:
> But this command is not working.

So what is it doing? Are there any error messages?

Without knowing aws, let me guess:
> ffmpeg -i <M3u8 Stream> -an -r 2 -t 60 -f image2 -vcodec mjpeg
> pipe:a_%0d.jpg | aws s3 cp - s3://ffmpegbucket-1/

The documentation for the "cp" command says: "Copies a local file or S3
object to another location locally or in S3." From those words, I would
guess it cannot handle stdin ("-"). And even if it did, you didn't name
a target file.

You do realize that your ffmpeg command outputs a stream of JPEG
images, and not a set of files? "pipe:a_%0d.jpg" most likely will not
nearly do what you expect it to.

> The objective is read a live stream keep generating frames and as soon I
> get 1st frame transfer it to AWS S3 bucket. So this will be continous
> upload process

You can probably do this from outside the ffmpeg command, by letting
ffmpeg create files, and checking the directory for the resulting files
before copying.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Uploading output of ffmpeg to AWS S3

Tarun singhal
On 7 June 2018 at 18:57, Moritz Barsnick <[hidden email]> wrote:

> On Thu, Jun 07, 2018 at 17:39:06 +0530, tarun singhal wrote:
> > But this command is not working.
>
> So what is it doing? Are there any error messages?
>
> Without knowing aws, let me guess:
> > ffmpeg -i <M3u8 Stream> -an -r 2 -t 60 -f image2 -vcodec mjpeg
> > pipe:a_%0d.jpg | aws s3 cp - s3://ffmpegbucket-1/
>
> The documentation for the "cp" command says: "Copies a local file or S3
> object to another location locally or in S3." From those words, I would
> guess it cannot handle stdin ("-"). And even if it did, you didn't name
> a target file.
>
> You do realize that your ffmpeg command outputs a stream of JPEG
> images, and not a set of files? "pipe:a_%0d.jpg" most likely will not
> nearly do what you expect it to.
>
> > The objective is read a live stream keep generating frames and as soon I
> > get 1st frame transfer it to AWS S3 bucket. So this will be continous
> > upload process
>
> You can probably do this from outside the ffmpeg command, by letting
> ffmpeg create files, and checking the directory for the resulting files
> before copying.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


Your approach wont work, as I am looking for something real time, It would
add latency, if i 1st copy local and then transfer to S3.

It is not giving error, its not doing what I need it to do. Probably
something is missing, But I am sure there should be some way
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Uploading output of ffmpeg to AWS S3

Carl Eugen Hoyos-2
In reply to this post by Tarun singhal
2018-06-07 14:09 GMT+02:00, tarun singhal <[hidden email]>:

> ffmpeg -i <M3u8 Stream> -an -r 2 -t 60 -f image2 -vcodec mjpeg
> pipe:a_%0d.jpg | aws s3 cp - s3://ffmpegbucket-1/

Assuming you can make the pipe work, use -f rawvideo
instead of -f image2

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".