Wie codiert man h.264 mit libavcodec / x264?

Ich bin versucht zu Kodieren von video mit libavcodec/libavformat. Audio funktioniert gut, aber wenn ich versuchen zu codieren, bekomme ich folgenden Fehler:

[libx264 @ 0x10182a000]broken ffmpeg default settings detected  
[libx264 @ 0x10182a000]use an encoding preset (vpre)  

einfach zu beheben über die Kommandozeile ffmpeg, aber ich versuche zu tun das in C.
meine Optionen sind

AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0);  
AVCodecContext *pVideoOutCodecCtx  = pVideoOutStream->codec;  

pVideoOutCodecCtx->codec_id        = CODEC_ID_H264;    
pVideoOutCodecCtx->codec_type      = CODEC_TYPE_VIDEO;  
pVideoOutCodecCtx->bit_rate        = pVideoInCodecCtx->bit_rate;  
pVideoOutCodecCtx->width           = pVideoInCodecCtx->width;    
pVideoOutCodecCtx->height          = pVideoInCodecCtx->height;  
pVideoOutCodecCtx->pix_fmt         = pVideoInCodecCtx->pix_fmt;    
pVideoOutCodecCtx->sample_rate     = pVideoInCodecCtx->sample_rate;    
pVideoOutCodecCtx->gop_size        = 30;  

aber avcodec_open() fehlschlägt.

Welche anderen Werte muss ich einstellen, um x264 glücklich?

InformationsquelleAutor der Frage szatmary | 2010-08-24

Schreibe einen Kommentar