}
// Write metadata
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
+ for ( i = 0; i < mlt_properties_count( properties ); i++ )
+ {
+ char *name = mlt_properties_get_name( properties, i );
+ if ( name && !strncmp( name, "meta.attr.", 10 ) )
+ {
+ char *key = strdup( name + 10 );
+ char *markup = strrchr( key, '.' );
+ if ( markup && !strcmp( markup, ".markup") )
+ {
+ markup[0] = '\0';
+ if ( !strstr( key, ".stream." ) )
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(43<<8)+0)
+ av_metadata_set2( &oc->metadata, key, mlt_properties_get_value( properties, i ), 0 );
+#else
+ av_metadata_set( &oc->metadata, key, mlt_properties_get_value( properties, i ) );
+#endif
+ }
+ free( key );
+ }
+ }
+#else
char *tmp = NULL;
int metavalue;
metavalue = mlt_properties_get_int( properties, "meta.attr.track.markup");
if (metavalue != 0) oc->track = metavalue;
+#endif
oc->oformat = fmt;
snprintf( oc->filename, sizeof(oc->filename), "%s", filename );
{
int i;
char key[200];
+ AVMetadataTag *tag = NULL;
mlt_properties_set_int( meta_media, "meta.media.nb_streams", context->nb_streams );
// mlt_properties_set_int( meta_media, key, codec_context->profile );
// snprintf( key, sizeof(key), "meta.media.%d.codec.level", i );
// mlt_properties_set_int( meta_media, key, codec_context->level );
+
+ // Read Metadata
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
+ while ( ( tag = av_metadata_get( stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX ) ) )
+ {
+ if ( tag->value && strcmp( tag->value, "" ) && strcmp( tag->value, "und" ) )
+ {
+ snprintf( key, sizeof(key), "meta.attr.%d.stream.%s.markup", i, tag->key );
+ mlt_properties_set( meta_media, key, tag->value );
+ }
+ }
+#endif
}
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
+ while ( ( tag = av_metadata_get( context->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX ) ) )
+ {
+ if ( tag->value && strcmp( tag->value, "" ) && strcmp( tag->value, "und" ) )
+ {
+ snprintf( key, sizeof(key), "meta.attr.%s.markup", tag->key );
+ mlt_properties_set( meta_media, key, tag->value );
+ }
+ }
+#else
+ if ( context->title && strcmp( context->title, "" ) )
+ mlt_properties_set(properties, "meta.attr.title.markup", context->title );
+ if ( context->author && strcmp( context->author, "" ) )
+ mlt_properties_set(properties, "meta.attr.author.markup", context->author );
+ if ( context->copyright && strcmp( context->copyright, "" ) )
+ mlt_properties_set(properties, "meta.attr.copyright.markup", context->copyright );
+ if ( context->comment )
+ mlt_properties_set(properties, "meta.attr.comment.markup", context->comment );
+ if ( context->album )
+ mlt_properties_set(properties, "meta.attr.album.markup", context->album );
+ if ( context->year )
+ mlt_properties_set_int(properties, "meta.attr.year.markup", context->year );
+ if ( context->track )
+ mlt_properties_set_int(properties, "meta.attr.track.markup", context->track );
+#endif
return meta_media;
}
#endif
}
- // Read Metadata
- if ( context->title )
- mlt_properties_set(properties, "meta.attr.title.markup", context->title );
- if ( context->author )
- mlt_properties_set(properties, "meta.attr.author.markup", context->author );
- if ( context->copyright )
- mlt_properties_set(properties, "meta.attr.copyright.markup", context->copyright );
- if ( context->comment )
- mlt_properties_set(properties, "meta.attr.comment.markup", context->comment );
- if ( context->album )
- mlt_properties_set(properties, "meta.attr.album.markup", context->album );
- if ( context->year )
- mlt_properties_set_int(properties, "meta.attr.year.markup", context->year );
- if ( context->track )
- mlt_properties_set_int(properties, "meta.attr.track.markup", context->track );
-
// We're going to cheat here - for a/v files, we will have two contexts (reasoning will be clear later)
if ( av == 0 && audio_index != -1 && video_index != -1 )
{