Page 1 of 1

ffmpeg: "Could not write header for output file"

Posted: Sun Nov 12, 2006 4:31 pm
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)

Encode as XviD right away!

Posted: Sun Nov 12, 2006 5:24 pm
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