javacv version is 1.5.8,the server is nginx-http-flv-module,the front is : vue+flv.js;
then the page console print error:DemuxException: type = CodecUnsupported, info = Flv: Unsupported codec in video frame: 12
my code is:
`public static Boolean start(String deviceId, String formUrl, String toUrl) {
if (null != get(deviceId)) return true;
final RtmpAnalyseHandler convertVideoPakcet = new RtmpAnalyseHandler();
BaseConstants.CONVERT_VIDEO_PACKETS.put(deviceId, convertVideoPakcet);
new Thread(() -> {
LOG.info("start device");
try {
convertVideoPakcet.rtsp(formUrl).rtmp(toUrl).start();
} catch (IOException e) {
LOG.error("start dvice error,{}", e);
} catch (Exception e) {
e.printStackTrace();
}
}).start();
LOG.info("start device finish!");
return true;
}
javacv version is 1.5.8,the server is nginx-http-flv-module,the front is : vue+flv.js; then the page console print error:DemuxException: type = CodecUnsupported, info = Flv: Unsupported codec in video frame: 12
my code is: `public static Boolean start(String deviceId, String formUrl, String toUrl) { if (null != get(deviceId)) return true; final RtmpAnalyseHandler convertVideoPakcet = new RtmpAnalyseHandler(); BaseConstants.CONVERT_VIDEO_PACKETS.put(deviceId, convertVideoPakcet); new Thread(() -> { LOG.info("start device"); try { convertVideoPakcet.rtsp(formUrl).rtmp(toUrl).start(); } catch (IOException e) { LOG.error("start dvice error,{}", e); } catch (Exception e) { e.printStackTrace(); } }).start(); LOG.info("start device finish!"); return true; }
// record.setAudioChannels(audioChannels); // record.setAudioBitrate(audioBitrate); // record.setSampleRate(sampleRate); AVFormatContext fc = null; record.setVideoOption("preset", "ultrafast"); record.setFormat("flv"); record.setAudioCodecName("aac"); // record.setVideoCodec(codecid); record.setVideoCodec(avcodec.AV_CODEC_ID_H264); fc = grabber.getFormatContext(); record.start(fc); // record.start(); LOG.info("rtmp start end"); return this; }
Does anyone know why? thank you very much!