Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8611707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:26:31+00:00 2026-06-12T04:26:31+00:00

I am trying to encode many videos on my server, but FFMPEG is resource

  • 0

I am trying to encode many videos on my server, but FFMPEG is resource intensive so I would like to setup some form of queueing. The rest of my site is using PHP, but I don’t know if I should use PHP, Python, BASH, etc. I was thinking I might need to use CRON but I am not really sure exactly how to tell ffmpeg to start a new task (from the list) after it finishes the one before it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:26:32+00:00Added an answer on June 12, 2026 at 4:26 am

    We will use FIFO (First In First Out) in a bash script. The script needs to run before cron (or any script, any terminal that call the FIFO) to send ffmpeg commands to this script :

    #!/bin/bash
    
    pipe=/tmp/ffmpeg
    
    trap "rm -f $pipe" EXIT
    
    # creating the FIFO    
    [[ -p $pipe ]] || mkfifo $pipe
    
    while true; do
        # can't just use "while read line" if we 
        # want this script to continue running.
        read line < $pipe
    
        # now implementing a bit of security,
        # feel free to improve it.
        # we ensure that the command is a ffmpeg one.
        [[ $line =~ ^ffmpeg ]] && bash <<< "$line"
    done
    

    Now (when the script is running), we can send any ffmpeg commands to the named pipe by using the syntax :

    echo "ffmpeg -version" > /tmp/ffmpeg
    

    And with error checking:

    if [[ -p /tmp/ffmpeg ]]; then
        echo "ffmpeg -version" > /tmp/ffmpeg
    else
        echo >&2 "ffmpeg FIFO isn't open :/"
    fi
    

    They will be queuing automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to encode some chains to MD5 but I have noticed that: For
I'm trying to encode some denotational semantics into Agda based on a program I
I'm trying to URL encode a string to form a GET request from objective-c.
I am trying to build an application in python that would encode and decode
I'm trying to encode acute accent letters in PHP. I used rawurlencode, but it
Im trying to encode some html within json from PHP. The function requests data
I am trying to encode some data ( a very big string actually )
Im trying to encode into a NSValue an multidimensional array of structs. This is
I am trying to encode a list as JSON, compress it using gzip in
I am trying to encode a matrix that i have (after calculating frame differences)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.