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 7730577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:15:37+00:00 2026-06-01T06:15:37+00:00

I have had incredible trouble building a binary of ffmpeg for Mac that works

  • 0

I have had incredible trouble building a binary of ffmpeg for Mac that works correctly for all of my needs. I have an older build that works great remuxing h264 video without problems but lacks a library I need, namely libspeex. I built a newer build based on ffmpeg’s git that includes libspeex but crashes when trying to remux h264 from .flv files with bad timecodes (live dumps from rtmpdump). So I have two ffmpeg binaries that each do half of what I need. This is what I have as my current .command file:

for f in ~/Desktop/Uploads/*.flv
do
/usr/local/bin/ffmpeg -i "$f" -vcodec copy -acodec libfaac -ab 128k -ar 48000 -async 1 "${f%.*}".mp4 && rmtrash "$f" || rmtrash "${f%.*}".mp4
done

This ffmpeg binary has libspeex included so it can decode speex audio in the .flv input files. What I’m looking to do is something like this pseudocode:

for f in ~/Desktop/Uploads/*.flv
do
ffprobe input.flv
    if Stream #0:1 contains speex
        ffmpeg-speex -i input.flv -acodec copy -async 1 output.m4a
    fi
ffmpeg-h264 -i input.flv -vcodec copy output.mp4
MP4Box -add output.mp4 -add output.m4a finaloutput.mp4
done

Is something like this possible? Are there any alternatives?

  • 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-01T06:15:38+00:00Added an answer on June 1, 2026 at 6:15 am

    You could run grep on its output and test whether it found your desired string:

    for f in ~/Desktop/Uploads/*.flv; do
        if ffprobe ${f} 2>&1 | egrep 'Stream #0:1.+speex'; then
            ffmpeg-speex -i ${f} -acodec copy -async 1 ${f/%.flv/.m4a}
            SPEEX_ADD="-add ${f/%.flv/.m4a}"
        fi
        ffmpeg-h264 -i ${f} -vcodec copy ${f/%.flv/.mp4}
        MP4Box -add ${f/%.flv/.mp4} ${SPEEX_ADD} ${f/%.flv/-final.mp4}
    done
    

    Assuming an input file abc.flv, ffmpeg-speex would output abc.m4a, ffmpeg-h264 would output abc.mp4, and MP4Box would output abc-final.mp4.

    Edit: Fixed to grep on stderr also; fixed problem where non-existent .m4a file might be given to MP4Box as an input.

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

Sidebar

Related Questions

I have had a look all over, but it doesn't seem as though my
I have had several situations when i would like to do that. This could
I'm looking to build a library that needs to be very careful about memory
I have had to work on a project that was written by someone else,
I have an installer of an application that needs to install over any existing
I am building a screen that will have a tutorial article, and is obviously
I have had an online archive service for over a year now. Unfortunately, I
I have had to compile my app for the 4.0 sdk to run on
I have had a persistent problem with Visual Studio 2010 and any framework version
I have had this problem crop up a few times and I can't figure

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.