gmf icon indicating copy to clipboard operation
gmf copied to clipboard

../format_go112.go:287:26: ctx.avCtx.filename undefined (type *_Ctype_struct_AVFormatContext has no field or method filename)

Open liangshuguang opened this issue 4 years ago • 4 comments

Hello, why can't I find this method when I compile and install ffmpeg? Is there something wrong with my practice? I follow readme.md step by step.

1634883378047

root@fb0f71201404:/data/gmf/examples# pkg-config --libs libavformat libavdevice libavfilter -L/usr/local/ffmpeg/lib -lavformat -lavdevice -lavfilter

../format_go112.go:287:26: ctx.avCtx.filename undefined (type *_Ctype_struct_AVFormatContext has no field or method filename) ../format_go112.go:333:45: ctx.avCtx.filename undefined (type *_Ctype_struct_AVFormatContext has no field or method filename) ../format_go112.go:335:45: ctx.avCtx.filename undefined (type *_Ctype_struct_AVFormatContext has no field or method filename) ../frame_go112.go:114:24: f.avFrame.pkt_pts undefined (type *_Ctype_struct_AVFrame has no field or method pkt_pts) ../frame_go112.go:122:11: f.avFrame.pkt_pts undefined (type *_Ctype_struct_AVFrame has no field or method pkt_pts) ../stream.go:48:12: s.avStream.codec undefined (type *_Ctype_struct_AVStream has no field or method codec) ../stream.go:60:38: s.avStream.codec undefined (type *_Ctype_struct_AVStream has no field or method codec) ../stream.go:78:40: s.avStream.codec undefined (type *_Ctype_struct_AVStream has no field or method codec)

liangshuguang avatar Oct 22 '21 06:10 liangshuguang

Hello.

Well, filename field has been removed from AVFormatContext in latest version of FFmpeg. GMF doesn't have support for new "url's" for now. As a workaround You can build older version of FFmpeg, e.g. try to checkout fc3f5cd149326b0a478c9a4a34acc22cf757ef02 commit. It works on my system.

3d0c avatar Oct 22 '21 08:10 3d0c

Thank you very much for your answer. What version of ffmpeg do you use? What version should I use?

liangshuguang avatar Oct 22 '21 14:10 liangshuguang

This change was introduced at Feb 26 11:33:09 2021, so everything before n4.3.2 will work.

3d0c avatar Oct 22 '21 15:10 3d0c

Thank you very much for your answer. I already know how to do it. I'm glad to receive your reply. Thank you for helping me solve my problem.

Can you help me solve a problem, that is, the time when I transcode with mp4s-to-flv.go in the lower version of ffmpeg is wrong. bbb.mp4 is 00:01:00, and the flv I transcode is 55 seconds. I think it should be the problem of time base. How can I set it correctly?

liangshuguang avatar Oct 22 '21 16:10 liangshuguang