1

I have a large batch (400+) of mp4 files I wish to convert to webm.

I've tried:

ffmpeg -i myfile.mp4 -c:v libvpx -minrate 1M -maxrate 1M  -b:v 1M myfile.webm

but the file is corrupt when I try to play it. Could anyone help? Here is input data for one of the mp4 files... I'm not really good enough with these things to know what it all means, but I tried my best to pull out bits I thought might be relevant.

Format                                   : MPEG-4
File size                                : 2.18 MiB
Duration                                 : 1s 857ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 9 829 Kbps

Video
Codec ID                                 : 20
Bit rate mode                            : Constant
Bit rate                                 : 9 808 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 59.940 fps
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.178
Stream size                              : 2.15 MiB (99%)
Writing library                          : Lavc54.59.100
pomegranate
  • 755
  • 5
  • 19

1 Answers1

3

When I do that with an MP4 file of my own, the output actually plays fine in both mplayer and vlc; you might want to read ffmpegs official examples on this.

You should define the audio format you want to use; whatever tells you the file is "broken" maybe doesn't like what it sees, which probably is what was in the MP4 container to begin with:

 ffmpeg -i input.mp4 -c:v libvpx -qmin 0 -qmax 50 -crf 5 -b:v 1M -c:a libvorbis output.webm
Marcus Müller
  • 34,677
  • 4
  • 53
  • 94