ffmpeg: "Could not write header for output file"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

ffmpeg: "Could not write header for output file"

Post by ^rooker »

[PROBLEM]
I wanted to convert a DVD (.vob) to .avi (video: MJPEG / audio: PCM), but received this error:
Could not write header for output file #0 (incorrect codec parameters ?)
[SOLUTION]
Unfortunately there seems to an ffmpeg-problem when muxing pcm audio in an avi. Currently I was only able to rip the audio separatedly from the video if I want it uncompressed:
Video (as MJPEG, 10Mbps)

Code: Select all

ffmpeg -i "INPUT.VOB" -vcodec mjpeg -b 10000 -f avi -croptop 90 -cropbottom 90 -aspect 16:9 -s 528x296 -an -y "output.avi" -map 0.0:0.0
Audio (as stereo PCM 16bit)

Code: Select all

ffmpeg -i "INPUT.VOB" -vn -f s16be -acodec pcm_s16be -ac 2 -y "output.wav" -map 0.1:0.0
Must try if it's possible to save the audio directly with a WAV header instead of just raw audio (signed, 16bit, stereo)
Last edited by ^rooker on Sun Nov 12, 2006 5:25 pm, edited 1 time in total.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Encode as XviD right away!

Post by ^rooker »

Here's what I'm using for cropping/resizing/encoding directly from DVD to XviD (in case I remember)

Code: Select all

ffmpeg -i "INPUT.VOB" -vcodec mpeg4 -g 240 -b 850 -cropleft 10 -cropright 10 -croptop 90 -cropbottom 90 -aspect 16:9 -s 528x296 -acodec mp3 -ab 128 -ac 2 -mbd 2 -vtag xvid -qmin 2 -async 1 -y "output.avi" -map 0.0:0.0 -map 0.1:0.1
Post Reply