Error while opening codec for output stream #0.1 – maybe incorrect parameters such as bit_rate, rate, width or height

08Nov07

Piece a crap! I’ve spent half a day debugging this error..

So you are trying to convert some avi movies into flv and get rich with your video uploading website.. You’ve tested you upload video functionality and it works flawless, untill some guy comes and say: hey i’ve tried to upload this video and it didn’t work. You run to the Linux console do a log print and you receive this beautiful error:

FFmpeg version SVN-r10964, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libmp3lame --enable-shared --prefix=/usr --enable-libogg --enable-libvorbis
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.18.0
built on Nov 8 2007 14:12:36, gcc: 4.1.1 20061011 (Red Hat 4.1.1-30)
Input #0, avi, from 'files/3635634.avi':
Duration: 00:00:18.1, start: 0.000000, bitrate: 660 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 320x240 [PAR 0:1 DAR 0:1], 15.00 fps(r)
Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s
Output #0, flv, to 'files/3635634.flv':
Stream #0.0: Video: flv, yuv420p, 320x240 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 15.00 fps(c)
Stream #0.1: Audio: libmp3lame, 11024 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[flv @ 0x7c77d0]removing common factors from framerate
Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height

You run manually the command :

ffmpeg -y -i input_video.avi -f flv output_video.flv

...and the error doesn't dissapear

After googling around reading ffmpeg documentation i found the solution. You need to manually set the sampling frequency like this:

ffmpeg -y -i files/input_file.avi -ar 22050 -f flv files/output_file.flv

Later edit: Post has been updated . Thanks to Peter



59 Responses to “Error while opening codec for output stream #0.1 – maybe incorrect parameters such as bit_rate, rate, width or height”

  1. 1 Markus

    Man! This is great!!! Thanx for the solution. Had the same problem. 🙂
    Thanx again.

  2. 3 Peter

    “-ar 22050” is not the bitrate, it’s the sampling frequency! “-ab” is the bitrate…

    Or am I missing something?

  3. 4 Alex

    Thanks a ton!

  4. 5 Zain

    Thanks for the article helped me debug the problem.

    In the article you say:
    maybe incorrect parameters such as bit_rate, rate, width or height – rate doesn’t have to do with audio. Why? Can you please explain.

    I think Peter is right. Its a problem with the audios sampling frequency rate not the bit_rate. I could be wrong.

  5. 6 toni

    Found via Google, thanks!

    I had to add addiotional “-ac 2” to tell ffmpeg we’re having stereo audio.

  6. 7 lev

    Thank you thank you thank you! I spent all day recompiling several versions of ffmpeg before i found this. Worked like a charm!

  7. 8 lhoussin

    Thankyou very much. It works!

  8. 9 Alexxz

    Toni thnx

  9. 10 ali

    Thank you very much ! worked like a charm..

  10. 11 chaitanya

    Hello dude,

    here i want u to solve my problem!!!
    i tried to convert a movie from .VOB to MP4 format then ERROR MESSAGE

    Error while opening codec for output stream #0.1 – maybe incorrect parameters such as bit_rate, rate, width or height
    is displaying 4 only one file . now how can i convert it to mp4

    plz suggest me an answer !!
    i hope u will n thank u!!!!
    Waiting 4 ur reply!!!!!

  11. 12 gabeget

    Thank you very very much for sharing this with us :D!!!
    I was trying mine with -r when it should have been -ar all long!
    Thanks again! Much appreciated!

  12. Thanks alot Dude.

  13. and then the quality become bad as Chuck Norris ..

  14. 15 ruff

    thanks for sharing info %)

  15. 16 Tplayer

    can someone simplify the solution. I’m not sure where to enter these commands.
    I’m trying to run E.M. total Video Converter. I keep getting that same error but I don’t see anywhere to make those changes.

    Regards,
    Tplayer

  16. 17 aiurdin

    thanks man, very useful!

  17. 18 dV

    Man you great!

  18. 19 Zeissberg

    Finally, was getting annoyed already.
    Thanks a lot

  19. I’m same problem..

    Error while opening codec for output stream #0.1 – maybe incorrect parameters such as bit_rate, rate, width or height

    command.
    ffmpeg -i princess.avi -ab 56 -ar 44100 -b 320 -r 24 -sameq -f flv princess.flv

    ffmpeg -y -i princess.avi -f flv princess.flv

    ffmpeg -y -i princess.avi -ar 22050 -f flv princess.flv

    ffmpeg -y -i files/princess.avi -ar 22050 -f flv files/princess.flv

    I don’t understand…

    is that wrong my command?

  20. 21 skrewler

    Here’s how I got it to work:

    ffmpeg -y -i video.mkv -ar 22050 -ac 2 -vcodec flv output.flv

    Hope it helped..

  21. there are many free software video converters on the internet that we can download but the best ones are always paid version *

  22. 23 yoyo

    I also got this error when converting to mp4. Solution was to output to width and height that were multiples of 4. My input video was an odd height — 715 pixels. Specifying the size with “-s 1272×712” did the trick.

  23. 24 james

    thanks 🙂 very useful!

  24. ¡¡¡Thanks a lot!!!

    • 26 Tisha

      All things codnrseied, this is a first class post

    • Danae,I love you some much honey, I’m praying for your adventure and success in life, you’ve made some great discoveries. I’m so sorry these terrible things happened while you were under my protection, my watch. I love you I’m so sorry you’ve suffered to much. You are strong , intelligent and adventurous these traits will get you where you need to go. I am so proud of you and your strength. I don’t understand why shit happens but it does and you are an inspiration having gone through it. I love you dearly.

  25. Also had to add the “-ac 2” to resolve issue. Thanks!

    • I LOVE how you went out and actually ASKED people their opinions on this rather than taking the word of a study performed by a company that is IN advertising and PR! The days where a simple TV commercial or radio spot could sway a pe#o8n&rs217;s perception of a product are long gone.

  26. 30 T S Pawan

    Thanks a lot it working now.

  27. I’d been very happy to locate this blog.I want to by way of thanking people with this excellent look at!! My partner and i most certainly relishing every part of the idea and maybe you have bookmarked as their favorite to consider latest stuff you posting.

  28. 32 Robin Degen

    Adding -ac2 did the trick for me. Random.

  29. Hi there, You have done an incredible job. I will definitely digg it and personally recommend to my friends. I’m confident they will be benefited from this website.

  30. Matchless phrase 😉

  31. 35 anonymous coward

    You hero. Thanks for that – stumbled across it just when I was about to give up.

  32. Thanks a lot men. Just saved me a lot of headaches 😀

  33. [SOLVED]
    added -b 64k before output to set output bitrate (aconv = ffmpeg)

    ffmpeg -i input.avi -f avi -b 64k output.avi

    of

    avconv -i input.avi -f avi -b 64k output.avi

  34. Undeniably imagine that that you said. Your favorite
    justification appeared to be on the web the easiest thing to remember
    of. I say to you, I certainly get annoyed at the same time as folks consider issues that they plainly do
    not understand about. You controlled to hit the nail upon
    the top as well as outlined out the whole thing with no need side-effects
    , other folks can take a signal. Will probably be back to get more.
    Thank you

  35. However, there are several online interfaces available where
    one needs to click on different types of options to send HTML
    code in email or to generate HTML code. Wouldn’t it be easier if we could be able to save changes ourselves whenever we want. You can make corrections directly instead of having to search mistake through the code, if something does not seem OK for you.

  36. However, there are several online interfaces available where one needs
    to click on different types of options to send HTML code in email or to generate HTML code.

    Wouldn’t it be easier if we could be able to save changes ourselves whenever we want. Therefore it’s better to
    always do the intelligent point and take these tips.

  37. Horizontal Siding and Vertical Sliding refers to the outer layer of a wall, with shingles or boards
    or gaps subtly angled to shed water. It’s a good idea to have separate email promotions for prospects and customers, too, because you typically need to send different information to the different groups. Therefore it’s better to always
    do the intelligent point and take these tips.

    • 42 Ice

      I had been honored to receive a call from my friend when he found the important suggestions shared on the site. Looking at your blog post is a real great experience. Many thanks for thinking about readers just like me, and I wish you the best of acemnveiehts for a professional in this topic.

  38. 43 srini

    It didn’t work for me with all the options that are specified in the comments

  39. I have a notable analytical eye designed for detail and may
    foresee troubles before they will occur.

  40. I think other web-site proprietors should take this site as an model, very clean and magnificent user genial style
    and design, let alone the content. You are an expert
    in this topic!

  41. It’s difficult to find experienced people about this topic,
    but you sound like you know what you’re talking about!
    Thanks

  42. you are in point of facct a good webmaster. The web site loading spеed is amazing.
    It kijd of fеels that you’re doing any uniquе trick. Also,
    The contents are masterpiece. yօu’ve done a magnificent tazk
    onn his topic!

  43. All vide᧐s are hosted by 3rd ceebration sites.

    my website Creampie Compilation


  1. 1 ffmpeg video in flv umwandeln - Linux & Unix @ tutorials.de: Forum, Tutorial, Anleitung, Schulung & Hilfe
  2. 2 Wie mach ich flvs auf Ubuntu - FP
  3. 3 Full Article
  4. 4 john lewis glasgow jobs
  5. 5 best tile And grout Cleaning Company
  6. 6 Usa.colinandries.Be
  7. 7 Www.plourin.Fr
  8. 8 what alternative medicine
  9. 9 Personal Development Leadership
  10. 10 earth energy present

Leave a reply to Star Cancel reply