[FFmpeg-user] FFmpeg 3 example compilation error

seaguest tyhk1987 at gmail.com
Tue May 10 06:40:14 CEST 2016


Hello,

After I switch to remotes/origin/release/3.0 branch, I don't have the 
problem any more, however when I try to run the example code 
transcoding.c, I get the following error:

seaguest at DEV:~/ffmpeg_sources/FFmpeg/doc/examples$ ./transcoding cut.mp4 
cut2.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cut.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf57.25.100
   Duration: 00:00:20.02, start: 0.023220, bitrate: 2960 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1280x688, 2860 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, 
stereo, fltp, 94 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
[libx264 @ 0x25e0920] broken ffmpeg default settings detected
[libx264 @ 0x25e0920] use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x25e0920] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x25e0920] speed presets are listed in x264 --help
[libx264 @ 0x25e0920] profile is optional; x264 defaults to high
Cannot open video encoder for stream #0
Error occurred: Generic error in an external library

Here is the video format information:

seaguest at DEV:~/ffmpeg_sources/FFmpeg/doc/examples$ ffprobe cut.mp4
ffprobe version n3.0.2-2-g08c21bc Copyright (c) 2007-2016 the FFmpeg 
developers
   built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
   configuration: --prefix=/home/seaguest/ffmpeg_build 
--pkg-config-flags=--static 
--extra-cflags=-I/home/seaguest/ffmpeg_build/include 
--extra-ldflags=-L/home/seaguest/ffmpeg_build/lib --enable-gpl 
--enable-libx264 --enable-libx265 --enable-nonfree
   libavutil      55. 17.103 / 55. 17.103
   libavcodec     57. 24.102 / 57. 24.102
   libavformat    57. 25.100 / 57. 25.100
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 31.100 /  6. 31.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cut.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf57.25.100
   Duration: 00:00:20.02, start: 0.023220, bitrate: 2960 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1280x688, 2860 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, 
stereo, fltp, 94 kb/s (default)
     Metadata:
       handler_name    : SoundHandler


Could anyone help? why this example code doesn't work for H.264?

best regards

Yongkan



On 05/10/2016 09:52 AM, seaguest wrote:
> Hello everyone,
>
> I am trying the example for FFmpeg 3, but I get the following error:
>
> seaguest at DEV:~/ffmpeg_sources/FFmpeg/doc/examples$ make all
> cc -I/usr/local/include -Wall -g   -c -o muxing.o muxing.c
> muxing.c: In function ‘open_audio’:
> muxing.c:250:11: warning: implicit declaration of function 
> ‘avcodec_parameters_from_context’ [-Wimplicit-function-declaration]
>      ret = avcodec_parameters_from_context(ost->st->codecpar, c);
>            ^
> muxing.c:250:50: error: ‘AVStream {aka struct AVStream}’ has no member 
> named ‘codecpar’
>      ret = avcodec_parameters_from_context(ost->st->codecpar, c);
>                                                   ^
> muxing.c: In function ‘open_video’:
> muxing.c:432:50: error: ‘AVStream {aka struct AVStream}’ has no member 
> named ‘codecpar’
>      ret = avcodec_parameters_from_context(ost->st->codecpar, c);
>                                                   ^
> <builtin>: recipe for target 'muxing.o' failed
> make: *** [muxing.o] Error 1
>
>
> It said the AVStream doesn't have the codecpar member, but I checked 
> the avformat.h, I do see the codecpar in AVStream, could anyone help?
>
> best regards
>
> Yongkan



More information about the ffmpeg-user mailing list