fsphil / hacktv

Analogue TV transmitter for the HackRF
GNU General Public License v3.0
713 stars 84 forks source link

solution ffmpeg.c:1019:73: error: ‘AVStream {aka struct AVStream}’ has no member #39

Closed vanhoteen closed 5 years ago

vanhoteen commented 5 years ago

I had a problem and I put the same and the solution

problem ffmpeg.c: In function ‘av_ffmpeg_open’: ffmpeg.c:921:60: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codecpar’ if(av->video_stream == NULL && av->format_ctx->streams[i]->codecpar->codec_ty ^ ffmpeg.c:926:72: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codecpar’ f(s->audio && av->audio_stream == NULL && av->format_ctx->streams[i]->codecpar- ^ ffmpeg.c:928:33: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codecpar’ if(av->format_ctx->streams[i]->codecpar->channels <= 0) continue; ^ ffmpeg.c:960:6: warning: implicit declaration of function ‘avcodec_parameters_to_context’ [-Wimplicit-function-declaration] if(avcodec_parameters_to_context(av->video_codec_ctx, av->video_stream->codec ^ ffmpeg.c:960:73: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codecpar’ (avcodec_parameters_to_context(av->video_codec_ctx, av->video_stream->codecpar) ^ ffmpeg.c:1019:73: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codecpar’ (avcodec_parameters_to_context(av->audio_codec_ctx, av->audio_stream->codecpar) ^ Makefile:32: fallo en las instrucciones para el objetivo 'ffmpeg.o' make: *** [ffmpeg.o] Error 1

solution

1 sudo add-apt-repository ppa:jonathonf/ffmpeg-3 2 sudo apt update 3 sudo apt-get install ffmpeg 4 sudo apt-get install libavcodec-dev 5 sudo apt-get install libavformat-dev 6 sudo apt-get install libswscale-dev 7 sudo apt-get install libavutil-dev

fsphil commented 5 years ago

Which version of ffmpeg did you have before? I'm unsure which version is the minimum required. Possibly >= 3.1.0.