优化代码

PtzNew
Matthew 3 months ago
parent 238f0aeb4f
commit 120d7fdde7

@ -113,9 +113,6 @@ void dumpRtmpToMp4(const char* rtmpUrl, const char* outputPath, uint32_t duratio
AVFormatContext* outputFormatContext = nullptr; AVFormatContext* outputFormatContext = nullptr;
AVPacket packet; AVPacket packet;
av_register_all();
avformat_network_init();
// Open input RTMP stream // Open input RTMP stream
if (avformat_open_input(&inputFormatContext, rtmpUrl, nullptr, nullptr) != 0) { if (avformat_open_input(&inputFormatContext, rtmpUrl, nullptr, nullptr) != 0) {
fprintf(stderr, "Could not open input file '%s'\n", rtmpUrl); fprintf(stderr, "Could not open input file '%s'\n", rtmpUrl);
@ -222,7 +219,7 @@ void dumpRtspToMp4(const char* rtspUrl, const char* outputPath, uint32_t duratio
// Set the custom log callback // Set the custom log callback
av_log_set_callback(ffmpeg_log_callback); av_log_set_callback(ffmpeg_log_callback);
av_log_set_level(AV_LOG_VERBOSE); av_log_set_level(AV_LOG_WARNING);
#endif #endif

Loading…
Cancel
Save