You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge branch 'OpenShot:develop' into develop
This commit is contained in:
@@ -643,18 +643,20 @@ void FFmpegWriter::WriteHeader() {
|
||||
AV_SET_FILENAME(oc, path.c_str());
|
||||
|
||||
// Add general metadata (if any)
|
||||
for (std::map<std::string, std::string>::iterator iter = info.metadata.begin(); iter != info.metadata.end(); ++iter) {
|
||||
for (auto iter = info.metadata.begin(); iter != info.metadata.end(); ++iter) {
|
||||
av_dict_set(&oc->metadata, iter->first.c_str(), iter->second.c_str(), 0);
|
||||
}
|
||||
|
||||
// Set multiplexing parameters
|
||||
AVDictionary *dict = NULL;
|
||||
// For HEVC (H265) to playback on Apple devices: https://github.com/OpenShot/libopenshot/issues/990
|
||||
if (info.has_video && video_codec_ctx && video_codec_ctx->codec_id == AV_CODEC_ID_HEVC) {
|
||||
av_dict_set(&mux_dict, "tag:v", "hvc1", 0);
|
||||
}
|
||||
|
||||
bool is_mp4 = strcmp(oc->oformat->name, "mp4");
|
||||
bool is_mov = strcmp(oc->oformat->name, "mov");
|
||||
// Set dictionary preset only for MP4 and MOV files
|
||||
if (is_mp4 || is_mov)
|
||||
// Set multiplexing parameters (only for MP4/MOV containers)
|
||||
AVDictionary *dict = NULL;
|
||||
if (mux_dict) {
|
||||
av_dict_copy(&dict, mux_dict, 0);
|
||||
}
|
||||
|
||||
// Write the stream header
|
||||
if (avformat_write_header(oc, &dict) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user