metadata for videos

  • Gjoenge

    Gjoenge - 2013-03-20

    Looking at the database minidlna has scanned of my video folders it looks to be pretty complete in regards to metadata collection. Unfortunately it looks like this data isn't used anywhere. Would it be possible to make a request to represent this data like the folder structure already used for music files so you could get something like a genre / year / latest folder listing?

  • Gjoenge

    Gjoenge - 2013-03-24

    I'm experimenting with this change for the videoitem handling part in insert_containers, seems to be doing the job ok if others want to add the functionality:

        else if( strstr(class, "videoItem") )
            snprintf(sql, sizeof(sql), "SELECT GENRE from DETAILS where ID = %lld", detailID);
            ret = sql_get_table(db, sql, &result, &row, &cols);
            if( ret != SQLITE_OK )
            if( !row )
            char *genre = result[5];
            static struct virtual_item last_genre;
            static sqlite_int64 last_all_objectID = 0;
            char *tmpstr;
            if( genre )
            //Genre delimiter handling ; or /
            char delimiter[3] = "/";
            if (strstr(genre, ";"))
                sprintf(delimiter, ";");
            tmpstr = strtok (genre, delimiter);
              while (tmpstr != NULL)
                    // Handle result
                    if (strstr(tmpstr,"SciFi") || strstr(tmpstr,"Science Fiction")  )
                     strcpy(, "Sci-Fi");
                     strcpy(, tmpstr);
                    insert_container(, VIDEO_GENRE_ID, NULL, "genre.videoGenre", NULL, NULL, NULL, &objectID, &parentID);
                    sprintf(last_genre.parentID, VIDEO_GENRE_ID"$%"PRIX64, parentID);
                    last_genre.objectID = objectID;
                    sql_exec(db, "INSERT into OBJECTS"
                             " (OBJECT_ID, PARENT_ID, REF_ID, CLASS, DETAIL_ID, NAME) "
                             " ('%s$%"PRIX64"', '%s', '%s', '%s', %"PRId64", %Q)",
                             last_genre.parentID, last_genre.objectID, last_genre.parentID, refID, class, detailID, name);
                    tmpstr = strtok (NULL, delimiter);
            /* All Videos */
            if( !last_all_objectID )
                last_all_objectID = get_next_available_id("OBJECTS", VIDEO_ALL_ID);
            sql_exec(db, "INSERT into OBJECTS"
                         " (OBJECT_ID, PARENT_ID, REF_ID, CLASS, DETAIL_ID, NAME) "
                         " ('"VIDEO_ALL_ID"$%"PRIX64"', '"VIDEO_ALL_ID"', '%s', '%s', %"PRId64", %Q)",
                         last_all_objectID++, refID, class, detailID, name);
  • alain1980

    alain1980 - 2013-09-15

    hey would you be able to add support for all metadata (like plot summary) ?
    i would really like to be able to pass them to xmbc (as a upnp client)

  • Darkvater

    Darkvater - 2014-05-04

    Hi alain, try this:

    I've added support for genres, actors, director, year (current year was date added to minidlna lib), tagline (was already present but was sent as description), description.

    Sadly XMBC does not support everything and has proprietary tags for some fields so if you want this you would need to add XMBC-client specific entries.
    Do note that minidlna does not retrieve any metadata itself but uses either 'movie.nfo' or '<filename>.nfo' if available in the XMBC format so you will have to populate that data yourself. There are quite a few programs that can do it for you.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks