[FFmpeg-user] Advice for webm conversion

Benoit benoit at friry.net
Sun Jun 5 14:10:04 CEST 2011


Hi!

I try to convert VHS videos to webm.

First step was to acquire to mjpeg/pcm.  The files are huge: 500MB for 5 minutes!
Second step is now to convert to something smaller. I chose webm.

Question 1
----------
I'm looking for "good" quality, file size and compression duration are not my
primary concern.  

After a lot of search, my command is:
ffmpeg \
    -threads 0 \
    -i input.avi \
    -acodec libvorbis \
    -aq 40 -ac 2 \
    -vcodec libvpx \
    -vf "yadif=1:0,crop=in_w-24:in_h-8:8:0" \
    -g 200 -keyint_min 0 \
    -qmax 40 \
    -rc_lookahead 16 -skip_threshold 0 -level 116 \
    -r 50 \
    -f webm \
    output.webm

This seems good to me. Has anyone any advice?  Some options may
be useless, and there may be better choices. There is a lot
parameters, without a lot of documentation.  I've seen -altref,
-token_partitions, -lag, -mb_static_threshold,
-rc_buf_aggressivity, with no explanation.

Question 2
----------
Encoding fails for some files.

When failing, encoding ends with a message like that:
Killed 6294 fps=  7 q=0.0 size=   93503kB time=540.71 bitrate=1416.6kbits/s
(Seems to be "Killed" with the remaining of the progress status line)

Example file #1:
  Duration: 00:16:11.92, start: 0.000000, bitrate: 21295 kb/s
    Stream #0.0: Video: mjpeg, yuvj420p, 720x576, 25 tbr, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s

First try: the result for my example is a 68MB file.
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: vp8, yuv420p, 696x568, PAR 1:1 DAR 348:283, 50 fps, 50 tbr, 1k tbn, 50 tbc (default)
    Stream #0.1: Audio: vorbis, 44100 Hz, stereo, s16 (default)

Second try: the file is 92M
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: vp8, yuv420p, 696x568, PAR 1:1 DAR 87:71, 50 fps, 50 tbr, 1k tbn, 50 tbc (default)
    Stream #0.1: Audio: vorbis, 44100 Hz, stereo, s16 (default)

ffplay does not let moving in the file.  Moving with right/left arrays is ok,
but clicking on the video fails:
[matroska,webm @ 0x1cb93c0] Unknown entry 0xC5B
[matroska,webm @ 0x1cb93c0] Unknown entry 0x4028
[matroska,webm @ 0x1cb93c0] Unknown entry 0xB8
[matroska,webm @ 0x1cb93c0] Unknown entry 0x92
[matroska,webm @ 0x1cb93c0] Unknown entry 0x4408
[matroska,webm @ 0x1cb93c0] Unknown entry 0x6892
[matroska,webm @ 0x1cb93c0] Invalid EBML number size tag 0x05 at pos 30435518 (0x1d068be)
[vp8 @ 0x1cedfe0] Discarding interframe without a prior keyframe! 
  18.03 A-V:  5.851 s:0.0 aq=    0KB vq=    0KB sq=    0B f=0/0   
    Last message repeated 103 times

(Playing with VLC is similar.)

Example file #2:
  Duration: 00:00:41.32, start: 0.000000, bitrate: 20899 kb/s
    Stream #0.0: Video: mjpeg, yuvj420p, 720x576, 25 tbr, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Output file, successfully encoded:
[matroska,webm @ 0x1ed6d00] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from 'file.webm':
  Duration: 00:00:41.32, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: vp8, yuv420p, 696x568, PAR 1:1 DAR 87:71, 50 fps, 50 tbr, 1k tbn, 50 tbc (default)
    Stream #0.1: Audio: vorbis, 44100 Hz, stereo, s16 (default)

Playing with ffplay and vlc are OK.

Is it a bug? How to investigate encoding failure?

Thanks,
Benoit


More information about the ffmpeg-user mailing list