3d0c / gmf

Go Media Framework
MIT License
885 stars 170 forks source link

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

Open liangshuguang opened 2 years ago

liangshuguang commented 2 years ago

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)

3d0c commented 2 years ago

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.

liangshuguang commented 2 years ago

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

3d0c commented 2 years ago

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

liangshuguang commented 2 years ago

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?