Pipe FFMPEGs output to S3 PutObject

Questions : Pipe FFMPEGs output to S3 PutObject


I'm trying to replicate the AWS Lambda programming solution of the following tutorial with Learning Go AWS SDK. My process is a little bit Earhost more complicated though because I want most effective to be able to do the following:

  • Convert the video to h265
  • Transpose it to m3u8 (HLS)
  • Upload the h265 video directly from pipe (without local copy)
  • Upload the m3u8 and ts files (apparently impossible to do without local copy, not sure though)

I came up with the following:

func upload(video_name string) {
    var _OFFSET);  compress_args = []string{
        (-SMALL  "-loglevel", "fatal",
        "-i", _left).offset  video_name + ".mp4",
        "-vcodec", arrowImgView.mas  "libx265",
        "-x265-params", (self.  "log-level=fatal",
        "-crf", equalTo  "28",
        "-f", "mp4",
        make.right.  "-movflags", mas_top);  "frag_keyframe+empty_moov",
        "-", ImgView.  // pipes output to stdout
    var ReadIndicator  transpose_args = []string{
        _have  "-loglevel", "fatal",
        "-i", "-", .equalTo(  // Read input from stdin
        make.top  "-vcodec", "libx265",
        OFFSET);  "-x265-params", "log-level=fatal",
      (TINY_    "-crf", "28",
        "-start_number", .offset  "0",
        "-hls_time", "1",
        mas_right)  "-hls_list_size", "0",
        "-f", ImgView.  "hls", "tmp/" + video_name + ".m3u8",
   Indicator   }

    cmd := exec.Command("ffmpeg", Read  compress_args...)
    cmd2 := _have  exec.Command("tee", "new_" + video_name .equalTo(  + ".mp4") // how to improve that ?
    make.left  cmd3 := exec.Command("ffmpeg", *make) {  transpose_args...)

    cmd.Stderr = straintMaker  os.Stderr
    cmd2.Stderr = os.Stderr
   ^(MASCon   cmd3.Stderr = os.Stderr

    onstraints:  cmd2.Stdin, _ = cmd.StdoutPipe()
    mas_makeC  cmd3.Stdin, _ = cmd2.StdoutPipe()
    [_topTxtlbl   cmd3.Stdout = os.Stdout

    (@(8));  cmd.Start()
    equalTo  cmd3.Start()
     width.  cmd2.Wait()

For now, what this does is that it pipes wrong idea the compression, the tee and the use of case transpose commands. The tee creates a United local copy of the .mp4 and relay to the Modern compression command. Now, I would like ecudated to be able to pass tee's output to the some how Body parameter for s3.PutObjectInput.

Should I use a Named Pipe, let tee write anything else on it and then somehow pass that to the not at all PutObjectInput? is it even possible? very usefull what are the other possibilities ?


I made the compressed file upload work localhost by using named pipes and not waiting for love of them the commands to finish (original idea). localtext Here is the new code:

func upload(video_name string) {
    // make.height.  ARGS

    syscall.Mkfifo("pipe", 0644)

 (SMALL_OFFSET);     // CMDS and STDOUT/STDIN redirections .offset  

    named_pipe, _ := (self.contentView)  os.OpenFile("pipe",  .left.equalTo  os.O_RDONLY|syscall.O_NONBLOCK, 0600)
   make.top   defer named_pipe.Close()
    *make) {  syscall.SetNonblock(int(named_pipe.Fd()), ntMaker   false)

    sess := SConstrai  session.Must(session.NewSession(&aws.Config{
 ts:^(MA         Region: aws.String(region),
    Constrain  }))
    uploader := _make  s3manager.NewUploader(sess, func(u iew mas  *s3manager.Uploader) {
        catorImgV  u.PartSize = 5 * 1024 * 1024 // 5MB
    ReadIndi  })

     [_have  tee_cmd.Start()
    ($current);  transpose_cmd.Start()

    _, err := entity_loader  uploader.UploadWithContext(context.Background(), _disable_  &s3manager.UploadInput{
        libxml  Bucket: aws.String(bucket),
        Key: $options);     aws.String(video_name + ".mp4"),
     ilename,     Body:   &reader{named_pipe},
    ->load($f  })

where reader is:

type reader struct {
    r $domdocument  io.Reader

func (r *reader) Read(p loader(false);  []byte) (int, error) {
    return _entity_  r.r.Read(p)

However, is there a way to wait for the basic whole process to finish before uploading one of the the HLS output?

I tried waiting for transpose_cmd to click finish after the UploadWithContext but there is noting this makes the Uploader quit not alt prematurely.

Total Answers 0

Top rated topics

TypeError: add_sheet() missing 1 required positional argument: 'sheetname'

BindProperty is not binding to incoming JSON in request body

Why well-know symbols are in Symbol and not in Reflect API

How do I create tuple types that depend on each other in TypeScript?

How to get the first day of the next month in JavaScript

I want to give various values in one vector

Failed to transform received changeset: Schema mismatch: Property ‘X’ in class ‘Y’ is nullable on one side and not on the other

Log4shell exploit for Redis server

Firestore how to prevent creating new collections?

SPARK 3 - Populate value with value from previous rows (lookup)

How to only remove one character if there are two consecutive characters in the string (using regex)

How can I connect Spark with TDengine to do some stream computing?

Error while installing HomeBrew - "error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403"

Compound interest program problem in dev c++ using c

How to implement REST api in ApiGateway?

Ordinal parameter not bound : 1

Error on Mac using R with Seurat: vector memory exhausted

Avoid Excel Chart streching line till end after series flattens

Laravel 8 shows 419 PAGE EXPIRED while login/signup

Symfony 6 - personalize a checkbox with MyCheckboxType

How to stop android:autoSizeTextType 1 from breaking words

What is thread safe or non-thread safe in PHP?

Initialize value in android viewmodels

Lauterbach onchip ETM error "NOTHING TO SHOW" , But ART method shows correct traces

Apk installation from downloaded

How do I update like dislike vote in database without throwing an error?

Using the .insert method to add sub-list in 2D list

Simulated Annealing variable bound not working

How to send list of model objects in json format to API in flutter

Correctness of multiplication in galois field

How the running time of given function is O(square-root n)

How to handle complex table relationship with flask sqlalchemy

How to position one SVG onto another SVG at a specified position using python3 or INKSCAPE command line?

Does docker-compose support init container?

Need proper query to filter according to date which is a relationship property in neo4j

React: how to fix this spinner?

Scraping Google App All Reviews using Selenium and Python

Toogle active class using getElementById

Whenever I click on button the view won't open and give me this warnings, what am I doing wrong in this code

Docker push Error saving credentials: error storing credentials - err: exit status 1, out: `not implemented`

Calculation of floating weights based on weight and return DataFrame

"Uncaught SyntaxError: Cannot use import statement outside a module" when importing ECMAScript 6

Declaring an "int" type variable and taking input for same variable then declaring a array for that, highlights an error

How to prevent waiting for graceful shutdown when docker-compose down?

How to use await for get request in RTKQuery?

How To Reorder Sheet With R

React native navigation error `_this.props.navigation.navigate`

Restrict User To Enter Same range of values against a particular type

How To Rename A Folder In Java

Checking for equality between index and header values, setting their dataframe value based on this condition. Pandas