Error while opening codec for output stream #0.1 – maybe incorrect parameters such as bit_rate, rate, width or height
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
Filed under: Uncategorized | 59 Comments
Tags: codec, error, ffmpeg, stream, video conversion
Man! This is great!!! Thanx for the solution. Had the same problem. 🙂
Thanx again.
Anyone plz tell me where to enter those commands and how
“-ar 22050” is not the bitrate, it’s the sampling frequency! “-ab” is the bitrate…
Or am I missing something?
Thanks a ton!
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.
Found via Google, thanks!
I had to add addiotional “-ac 2” to tell ffmpeg we’re having stereo audio.
Thank you thank you thank you! I spent all day recompiling several versions of ffmpeg before i found this. Worked like a charm!
Thankyou very much. It works!
Toni thnx
Thank you very much ! worked like a charm..
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!!!!!
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!
Thanks alot Dude.
and then the quality become bad as Chuck Norris ..
thanks for sharing info %)
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
thanks man, very useful!
Man you great!
Finally, was getting annoyed already.
Thanks a lot
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?
Here’s how I got it to work:
ffmpeg -y -i video.mkv -ar 22050 -ac 2 -vcodec flv output.flv
Hope it helped..
there are many free software video converters on the internet that we can download but the best ones are always paid version *
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.
thanks 🙂 very useful!
¡¡¡Thanks a lot!!!
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.
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.
Thanks a lot it working now.
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.
Adding -ac2 did the trick for me. Random.
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.
Matchless phrase 😉
You hero. Thanks for that – stumbled across it just when I was about to give up.
Thanks a lot men. Just saved me a lot of headaches 😀
[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
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
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.
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.
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.
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.
It didn’t work for me with all the options that are specified in the comments
Times are chgnniag for the better if I can get this online!
I have a notable analytical eye designed for detail and may
foresee troubles before they will occur.
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!
It’s difficult to find experienced people about this topic,
but you sound like you know what you’re talking about!
Thanks
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!
All vide᧐s are hosted by 3rd ceebration sites.
my website Creampie Compilation