[Libav-user] Two pass encoding for VP8

Taha Ansari mtaha.ansari at gmail.com
Thu Mar 20 06:57:51 CET 2014


I am trying to simulate two-pass encoding using FFmpeg libraries. Code I
have so far is working fine for h264 codec, now I want it to work also for
VP8. Normal encoding (i.e. single pass) works fine, both for mp4, and webm;
but the changes in code for two pass works only for mp4s. I have tried to
tally code from ffmpeg.c file, and add it up in my encoding routines.

Looking closer at different locations, developer logs, etc., I have come
down to following possibilities:

- 'stats_out' buffer is never allocated (though documentation says it is
allocated automatically for encoding)
- avcodec_encode_video2(c, &pkt, frame, &got_output) never sets
'got_output' for first pass

Necessary bits of code:


In above code, for CODEC_FLAG_PASS1, stats file is created, but stats_out
is always NULL, and avcodec_encode_video2() never sets got_output, so code
under it is never executed.

Apparently I have missed out something, but cannot understand what,
exactly. Can anyone guide me towards my mistake?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140320/5eef8f3b/attachment.html>

More information about the Libav-user mailing list