From 977a4e526af5e6b8c3ab3b82487c6f259386485b Mon Sep 17 00:00:00 2001 From: NDrLEUxcwQsgKUWlrFELocR1z7QP <54683950+maxnut@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:42:42 +0100 Subject: [PATCH] fix hevc problem with colorspace --- src/audio_mixer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/audio_mixer.cpp b/src/audio_mixer.cpp index 27eacd7..11c4706 100644 --- a/src/audio_mixer.cpp +++ b/src/audio_mixer.cpp @@ -286,11 +286,6 @@ namespace ffmpeg { return; } - outputVideoStream->codecpar->codec_id = AV_CODEC_ID_H264; - outputVideoStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; - outputFormatContext->video_codec = avcodec_find_encoder(AV_CODEC_ID_H264); - outputFormatContext->video_codec_id = AV_CODEC_ID_H264; - if (!(outputFormatContext->oformat->flags & AVFMT_NOFILE)) { if (avio_open(&outputFormatContext->pb, outputMp4File.string().c_str(), AVIO_FLAG_WRITE) < 0) { geode::log::error("Could not open output file."); @@ -312,7 +307,7 @@ namespace ffmpeg { while (true) { if (av_read_frame(videoFormatContext, &packet) >= 0) { av_packet_rescale_ts(&packet, videoFormatContext->streams[videoStreamIndex]->time_base, outputVideoStream->time_base); - packet.stream_index = 0; + packet.stream_index = videoStreamIndex; av_interleaved_write_frame(outputFormatContext, &packet); av_packet_unref(&packet); } else {