Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5276 closed defect (invalid)

Encoding with libvpx-vp9 produces corrupt results

Reported by: Compizfox Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: libvpx
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm trying to produce some WebM files. VP8 encoding works fine, but I'd like to use VP9. To do this, I use the following command:

ffmpeg -i input.avi -c:v libvpx-vp9 -crf 30 -b:v 0 -speed 2 -threads 4 -c:a libvorbis output.webm

This takes quite a long time (at ~2 fps) but after it's done, the resulting WebM is unplayable. I tested with VLC, Firefox and Chrome. VLC just plays the audio but no video, Chrome doesn't do anything (clicking the play button does nothing) and Firefox says "Video can't be played because the file is corrupt".

The input file is a Lagarith-encoded AVI file.

I'm using the latest version from http://ffmpeg.zeranoe.com/builds/ (ffmpeg-20160227-git-5156578-win64-static).

Attachments (1)

ffmpeg-20160228-164421.log (56.2 KB ) - added by Compizfox 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Carl Eugen Hoyos, 9 years ago

Keywords: libvpx added

Please provide your complete, uncut console output to make this a valid ticket.
Either test with -f lavfi -i testsrc or provide your input sample.

in reply to:  1 comment:2 by Compizfox, 9 years ago

Replying to cehoyos:

Please provide your complete, uncut console output to make this a valid ticket.
Either test with -f lavfi -i testsrc or provide your input sample.

Alright. I did another test with the following command:

ffmpeg -v 9 -loglevel 99 -report -f lavfi -i testsrc -t 10 -c:v libvpx-vp9 -crf 30 -b:v 0 -speed 2 -threads 4 -c:a libvorbis out.webm

I get the same results: the output file is not playable.

I'll attach the log file.

by Compizfox, 9 years ago

Attachment: ffmpeg-20160228-164421.log added

comment:3 by Cigaes, 9 years ago

    Stream #0:0, 0, 1/1000: Video: vp9 (libvpx-vp9), 1 reference frame, gbrp, 320x240 [SAR 1:1 DAR 4:3], 1/25, q=-1--1, 25 fps, 1k tbn, 25 tbc

The video is encoded in RGB colorspace, this is quite bleeding edge. Try specifying -pix_fmt yuv444p or -pix_fmt yuv420p.

comment:4 by Carl Eugen Hoyos, 9 years ago

Resolution: invalid
Status: newclosed

Please reopen if FFmpeg is unable to decode the output file.

in reply to:  3 ; comment:5 by Compizfox, 9 years ago

Replying to Cigaes:

    Stream #0:0, 0, 1/1000: Video: vp9 (libvpx-vp9), 1 reference frame, gbrp, 320x240 [SAR 1:1 DAR 4:3], 1/25, q=-1--1, 25 fps, 1k tbn, 25 tbc

The video is encoded in RGB colorspace, this is quite bleeding edge. Try specifying -pix_fmt yuv444p or -pix_fmt yuv420p.

I tried with the option -pix_fmt yuv422p added (because my input file is also in that colour space) but that doesn't solve the problem.

Last edited 9 years ago by Compizfox (previous) (diff)

in reply to:  5 ; comment:6 by James, 9 years ago

Replying to Compizfox:

I tried with the option -pix_fmt yuv422p added (because my input file is also in that colour space) but that doesn't solve the problem.

Firefox, at least the current stable version, only supports yuv420p vp9 video. No idea about Chrome or VLC, but it's probably the same problem: VP9 Profiles 1 and above (yuv422p, yuv440p, yuv444p, 10 and 12 bit video) are relatively new and its use not widespread. Only the latest versions of libavcodec and libvpx can decode and encode them.

Use yuv420p to encode webm files that can be played with current browsers, or switch to a different video player that uses a more recent libavcodec or libvpx build.

in reply to:  6 comment:7 by Compizfox, 9 years ago

Replying to jamrial:

Replying to Compizfox:

I tried with the option -pix_fmt yuv422p added (because my input file is also in that colour space) but that doesn't solve the problem.

Firefox, at least the current stable version, only supports yuv420p vp9 video. No idea about Chrome or VLC, but it's probably the same problem: VP9 Profiles 1 and above (yuv422p, yuv440p, yuv444p, 10 and 12 bit video) are relatively new and its use not widespread. Only the latest versions of libavcodec and libvpx can decode and encode them.

Use yuv420p to encode webm files that can be played with current browsers, or switch to a different video player that uses a more recent libavcodec or libvpx build.

Thanks, that was indeed the issue! I didn't know this, nor was this mentioned in http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide or https://trac.ffmpeg.org/wiki/Encode/VP9.

Thanks all for your help.

comment:8 by Cigaes, 9 years ago

In the future, when people suggest you some test, you should run these tests. You can run extra tests if you want, but not instead.

Note: See TracTickets for help on using tickets.