moonfdd / ffmpeg-go

golang binding for ffmpeg
79 stars 23 forks source link

我用mp4文件推流,会报cgo错误 #3

Open 601630051 opened 1 year ago

601630051 commented 1 year ago

libPath= /home/go/test1/mprtmp linux Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './out/1.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 2022-11-14T08:12:41.000000Z Hw : 1 : bitRate : 16000000 : com.apple.quicktime.artwork: {"data":{"edittime":9276,"infoStickerId":"","musicId":"7137595027991037953","os":"windows","product":"lv","stickerId":"","videoEffectId":"","videoId":"b1b8942c-e319-497b-b4b3-e6894c4cc87e","videoParams":{"be":0,"ef":0,"ft":0,"ma":0,"me":0,"mu":1,"re":0,"s maxrate : 16000000 : te_is_reencode : 1 : encoder : Lavf58.76.100 Duration: 00:00:21.78, start: 0.000000, bitrate: 12773 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 12658 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc (default) Metadata: creation_time : 2022-11-14T08:12:41.000000Z handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 116 kb/s (default) Metadata: creation_time : 2022-11-14T08:12:41.000000Z handler_name : SoundHandler vendor_id : [0][0][0][0] Output #0, flv, to 'rtmp://192.168.2.220/live/4': Stream #0:0: Unknown: none Stream #0:1: Unknown: none [flv @ 0x1ab6140] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead. [flv @ 0x1ab6140] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

运行到这个pts_time := libavutil.AvRescaleQ(pkt.Dts, time_base, time_base_q),就把报错

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]: mprtmp/dylib.(LazyProc).CallOriginal.func4(0xc0000d0180?, {0xc00004fcd0?, 0xc00004fcd8?, 0xc00004fce0?}) /home/go/test1/mprtmp/dylib/dylib_posix.go:282 +0x8a mprtmp/dylib.(LazyProc).CallOriginal(0xc0000d0180, {0xc00004fcd0, 0x3, 0x3}) /home/go/test1/mprtmp/dylib/dylib_posix.go:282 +0xd5 mprtmp/dylib.(LazyDLL).call(0x48aa8e?, 0xc000014020?, {0xc00004fcd0?, 0x4e?, 0x4aeac0?}) /home/go/test1/mprtmp/dylib/dylib_posix.go:190 +0x9c5 mprtmp/dylib.(LazyProc).Call(...) /home/go/test1/mprtmp/dylib/dylib_posix.go:264 mprtmp/ffmpeg-go/libavutil.AvRescaleQ(0x73f780, {0x1, 0xf4240}, {0x1, 0xf4240}) /home/go/test1/mprtmp/ffmpeg-go/libavutil/mathematics.go:190 +0xc5 main.main0() /home/go/test1/mprtmp/mprtmp.go:140 +0x785 main.main() /home/go/test1/mprtmp/mprtmp.go:229 +0x2e5 exit status 2

moonfdd commented 1 month ago

需要把视频文件和代码给我看看。看提示AvRescaleQ这个函数有问题