Opened 3 years ago

Closed 3 years ago

Last modified 3 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 3 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 follow-up: Changed 3 years ago by cehoyos

  • 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.

comment:2 in reply to: ↑ 1 Changed 3 years ago by Compizfox

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.

Changed 3 years ago by Compizfox

comment:3 follow-up: Changed 3 years ago by 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.

comment:4 Changed 3 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:5 in reply to: ↑ 3 ; follow-up: Changed 3 years ago by Compizfox

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 3 years ago by Compizfox (previous) (diff)

comment:6 in reply to: ↑ 5 ; follow-up: Changed 3 years ago by 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.

comment:7 in reply to: ↑ 6 Changed 3 years ago by Compizfox

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 Changed 3 years ago by Cigaes

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.