0

I'm trying to convert a 200MB .ogv file to .avi with a script I found online:

#!/bin/bash
# ogv to avi
# Call this with multiple arguments
# for example : ls *.{ogv,OGV} | xargs ogv2avi
N=$#;
echo "Converting $N files !"
for ((i=0; i<=(N-1); i++))
do
echo "converting" $1
filename=${1%.*}
mencoder "$1" -ovc xvid -oac mp3lame -xvidencopts pass=1 -o $filename.avi
shift 1
done

After this all I have to do is $ ogv2avi name_of_file.ogv and it creates the converted.avi file.

It works great for small file, but it seems to crash for big files, and I only get around the first 3 minutes of the 30 minute recording.

Too many audio packets in the buffer: (4096 in 850860 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:10142.
Setting audio delay to 0.078s.

Video stream:  784.308 kbit/s  (98038 B/s)  size: 21254748 bytes  216.800 secs  3000 frames

Audio stream:   87.341 kbit/s  (10917 B/s)  size: 2372536 bytes  217.313 secs
Arturo
  • 3,679
  • 6
  • 34
  • 43
  • I just installed Devedo on Ubuntu to do the trick. I will get back here if it works. – Arturo Nov 23 '13 at 10:03
  • 1
    The example in a comment is [useless](http://partmaps.org/era/unix/award.html#ls); it is better written `ogv2avi *.{OGV,ogv}` or more portably (and somewhat more generally) `ogv2avi *.[Oo][Gg][Vv]`. – tripleee Nov 23 '13 at 10:04
  • Looks like a problem in `mencoder`, not in the script. – tripleee Nov 23 '13 at 10:06
  • I've already have mencoder installed, isn't that enough, or do I require some sort of update? – Arturo Nov 23 '13 at 10:35
  • 1
    The script you posted simply runs `mencoder` on a bunch of files, and the error message you post as problematic comes from `mencoder`. The script is by and large a red herring, and thus this question isn't programming-related. – tripleee Nov 23 '13 at 11:08

1 Answers1

1

I had the exact same problem, and the only way i got around it (a sloppy solution but it works) is to play the .ogv video on the Ubuntu Desktop and record the square were the video is located with a desktop recorder that don't produces .ogv files(I recommend Kazam which produces .webm files). Then use Audacity to edit the audio of the output video if necessary and mix the edited audio with the output video using MkvMerge.

jjf
  • 115
  • 3
  • 11