FFmpegFrameRecorder recorder = new FFmpegFrameRecorder("rtmp://localhost:1935/live/mp4test",
grabber.getImageWidth(), grabber.getImageHeight(), 0);
recorder.start(grabber.getFormatContext());
报错[flv @ 0000023391071840] Tag avc1 incompatible with output codec id '27' ([7][0][0][0])
这个错误是因为您传入的输出文件格式与您所使用的编码器不匹配。在您的代码中,您使用的是 "rtmp://localhost:1935/live/mp4test" 作为输出文件的地址,这表明您希望输出为 mp4 格式。然而,您正在使用的编码器 ID 为 '27',它对应的是 flv 格式。
需要确保您传入的编码器与您要输出的文件格式相匹配。对于mp4格式可以使用 '28'对应 libx264来做编码。
如果您希望将输出保存为 flv 格式