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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:35:08+00:00 2026-05-27T08:35:08+00:00

I am trying to parse some output from the ffmpeg -i command. Some of

  • 0

I am trying to parse some output from the ffmpeg -i command. Some of the output may look like this:

  libavutil     50. 8. 0 / 50. 8. 0
  libavcodec    52.52. 0 / 52.52. 0
  libavformat   52.50. 0 / 52.50. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
  libpostproc   51. 2. 0 / 51. 2. 0
Input #0, avi, from '/my/folder/clip.mpeg':
  Duration: 00:05:25.00, start: 0.000000, bitrate: 554 kb/s
    Stream #0.0: Video: msvideo1, rgb555le, 160x100, 10 tbr, 10 tbn, 10 tbc

How can I parse out the bitrate value on the second last line? I cannot make a static parser that just picks the value at position x in the String because the output differs from time to time, so I have to make it dynamic in some way.

But how?

  • 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-05-27T08:35:09+00:00Added an answer on May 27, 2026 at 8:35 am

    You can use regular expressions.
    Try something like this :

    String text = "Duration: 00:05:25.00, start: 0.000000, bitrate: 554 kb/s";
    final Pattern p = Pattern.compile(".?bitrate:\\s([0-9]*)\\skb/s");
    final Matcher m = p.matcher(text);
    if(m.find())
    {
        System.out.println(m.group(1));
    }
    

    More on Java and regular expressions : http://docs.oracle.com/javase/tutorial/essential/regex/

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

Sidebar

Related Questions

I'm trying to parse some returned html (from http://www.google.com/movies?near=37130 )to look for currently playing
I am trying to parse some output data from and PBX and I have
Trying to parse some XML but apparently this is too much for a lazy
I am trying to parse some text and diagram it, like you would a
I have some trouble with python. I am trying to get output from a
I am trying to parse some data from external site to local script. Local
I'm trying to parse an html output file from a program called mirdeep. I
I'd like to parse a SOAPUI Project file and generate some documentation from the
I'm trying to parse some JSON data from the Google AJAX Search API. I
I am trying to parse the result output from a natural language parser (Stanford

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.