Skip to content

Commit

Permalink
fix hevc problem with colorspace
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnut committed Nov 25, 2024
1 parent 0bbadf2 commit 977a4e5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/audio_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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 {
Expand Down

0 comments on commit 977a4e5

Please sign in to comment.