[Libav-user] libvpx-vp9 encoding from C API

Gonzalo Garramuño ggarra13 at gmail.com
Wed Feb 7 15:55:40 EET 2024


I am looking for an example of using libvpx-vp9 encoding from the FFmpeg 
C libav* API.  I have compiled libvpx and linked it in into ffmpeg (and 
I can surely read vp9/webm files and can encode them with the ffmpeg 
command-line utility)

I've tried:

https://ffmpeg.org/doxygen/6.0/encode_video_8c-example.html

with:

$ encode_video output.mp4 libvpx-vp9

$ encode_video output.webm libvpx-vp9

which wrote an .mp4 and a .webm file, but it is not readable by ffplay 
or ffprobe.

$ ffprobe output.mp4
ffprobe version 6.0 Copyright (c) 2003-2023 the FFmpeg developers
   built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
   configuration: 
--prefix=/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install 
--enable-pic 
--extra-cflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-cxxflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-objcflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-ldflags='"-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib/"' 
--extra-ldflags='"/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib/libvpx.a"' 
--extra-ldflags=-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib 
--extra-ldflags=-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib64 
--x86asmexe=/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/bin/nasm 
--enable-libvpx --enable-static --enable-shared
   libavutil      58.  2.100 / 58.  2.100
   libavcodec     60.  3.100 / 60.  3.100
   libavformat    60.  3.100 / 60.  3.100
   libavdevice    60.  1.100 / 60.  1.100
   libavfilter     9.  3.100 /  9.  3.100
   libswscale      7.  1.100 /  7.  1.100
   libswresample   4. 10.100 /  4. 10.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f7900000c80] Format 
mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection 
possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f7900000c80] moov atom not found
output.mp4: Invalid data found when processing input

$  ffprobe output.webm
ffprobe version 6.0 Copyright (c) 2007-2023 the FFmpeg developers
   built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
   configuration: 
--prefix=/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install 
--enable-pic 
--extra-cflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-cxxflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-objcflags=-I/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/include 
--extra-ldflags='"-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib/"' 
--extra-ldflags='"/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib/libvpx.a"' 
--extra-ldflags=-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib 
--extra-ldflags=-L/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/lib64 
--x86asmexe=/home/gga/code/applications/mrv2/BUILD-Linux-amd64/Release/install/bin/nasm 
--enable-libvpx --enable-static --enable-shared
   libavutil      58.  2.100 / 58.  2.100
   libavcodec     60.  3.100 / 60.  3.100
   libavformat    60.  3.100 / 60.  3.100
   libavdevice    60.  1.100 / 60.  1.100
   libavfilter     9.  3.100 /  9.  3.100
   libswscale      7.  1.100 /  7.  1.100
   libswresample   4. 10.100 /  4. 10.100
[matroska,webm @ 0x55f3a6368d40] Format matroska,webm detected only with 
low score of 1, misdetection possible!
[matroska,webm @ 0x55f3a6368d40] EBML header parsing failed
output.webm: Invalid data found when processing input

-- 
Gonzalo Garramuño
ggarra13 at gmail.com



More information about the Libav-user mailing list