libav has no video encoders?

asked 2015-11-24 14:55:13 +0300

V10lator gravatar image

I'm currently working on a screen recorder for the Jolla phone. For encoding the video I want to use avutils as it's already preinstalled on the phone but I'm stuck.

This is what my program currently outputs:

$ ./SailfishRecorder test.file
Cannot find h264 codec (check your libav installation)

The corresponding code is:

AVCodec *codec = avcodec_find_encoder(CODEC_ID_H264);
if(!codec)
{
    fprintf(stderr, "Cannot find h264 codec (check your libav installation)\n");
    close(fd);
    fclose(file);
    return 1;
}

So I checked libav:

$ avconv -codecs                                                                      
avconv version 0.8.4, Copyright (c) 2000-2012 the Libav developers
  built on Sep 17 2015 17:21:37 with gcc 4.8.3 20140106 (Mer 4.8.3-1)
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...S.. = Supports draw_horiz_band
 ....D. = Supports direct rendering method 1
 .....T = Supports weird frame truncation
 ------
 DEA D  aac             Advanced Audio Coding
 D A D  aac_latm        AAC LATM (Advanced Audio Codec LATM syntax)
 D A D  flac            FLAC (Free Lossless Audio Codec)
 D VSDT h263            H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2
 D V D  h264            H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
 D A D  mp3             MP3 (MPEG audio layer 3)
 D VSDT mpeg4           MPEG-4 part 2
 D A D  pcm_f32be       PCM 32-bit floating point big-endian
 D A D  pcm_f32le       PCM 32-bit floating point little-endian
 D A D  pcm_f64be       PCM 64-bit floating point big-endian
 D A D  pcm_f64le       PCM 64-bit floating point little-endian
 D A D  pcm_s16be       PCM signed 16-bit big-endian
 D A D  pcm_s16le       PCM signed 16-bit little-endian
 D A D  pcm_s24be       PCM signed 24-bit big-endian
 D A D  pcm_s24le       PCM signed 24-bit little-endian
 D A D  pcm_s32be       PCM signed 32-bit big-endian
 D A D  pcm_s32le       PCM signed 32-bit little-endian
 D A D  pcm_s8          PCM signed 8-bit
 D A D  pcm_u16be       PCM unsigned 16-bit big-endian
 D A D  pcm_u16le       PCM unsigned 16-bit little-endian
 D A D  pcm_u24be       PCM unsigned 24-bit big-endian
 D A D  pcm_u24le       PCM unsigned 24-bit little-endian
 D A D  pcm_u32be       PCM unsigned 32-bit big-endian
 D A D  pcm_u32le       PCM unsigned 32-bit little-endian
 D A D  pcm_u8          PCM unsigned 8-bit
 D VSD  theora          Theora
 D A D  vorbis          Vorbis
 D VSD  vp3             On2 VP3

What I get from there is that it only supports aac encoding which isn't helpful at all. Am I doing something wrong or is there any reason we don't have encoders? Any other library I could use to encode?

edit retag flag offensive close delete

Comments

I'm too uncertain about this to be an answer, but gstreamer normally encodes too. I'd expect it supports hardware encoding as well.

Fuzzillogic ( 2015-11-25 00:36:53 +0300 )edit