Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not prefer an unsupported audio stream (iPhone 16) #620

Open
clsid2 opened this issue Oct 17, 2024 · 1 comment
Open

Do not prefer an unsupported audio stream (iPhone 16) #620

clsid2 opened this issue Oct 17, 2024 · 1 comment

Comments

@clsid2
Copy link
Contributor

clsid2 commented Oct 17, 2024

Sample file:
https://www.sendspace.com/file/5p09hb

Video recorded by iPhone 16. It contains two audio streams: AAC and apac (not yet supported by FFmpeg?).

The splitter selects the second track by default causing audio playback to fail. Turning off option to prefer best quality track solves that. But a better fix perhaps would be to ignore unknown/unsupported audio formats in the best track selection choice. Or just ignore this specific format if that is easier.

@clsid2
Copy link
Contributor Author

clsid2 commented Oct 17, 2024

Quick fix

--- a/demuxer/Demuxers/LAVFDemuxer.cpp
+++ b/demuxer/Demuxers/LAVFDemuxer.cpp
@@ -3012,6 +3012,10 @@ const CBaseDemuxer::stream *CLAVFDemuxer::SelectAudioStream(std::list<std::strin
                 AVStream *old_stream = m_avFormat->streams[best->pid];
                 AVStream *new_stream = m_avFormat->streams[(*sit)->pid];
 
+                if (new_stream->codecpar->codec_id == 0) {
+                    continue;
+                }
+
                 int check_nb_f = av_lav_stream_codec_info_nb_frames(new_stream);
                 int best_nb_f = av_lav_stream_codec_info_nb_frames(old_stream);
                 if (m_bRM && (check_nb_f > 0 && best_nb_f <= 0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant