Skip to content
Snippets Groups Projects
Commit b171f76a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Set mkv metadata

parent ef1360c5
No related branches found
No related tags found
No related merge requests found
Pipeline #26483 passed
......@@ -52,6 +52,8 @@ static AVStream *add_video_stream(AVFormatContext *oc, const ftl::codecs::Packet
st->codecpar->format = AV_PIX_FMT_NV12;
st->codecpar->bit_rate = 4000000;
if (pkt.flags & ftl::codecs::kFlagStereo) av_dict_set_int(&st->metadata, "stereo_mode", 1, 0);
/* put sample parameters */
//c->bit_rate = 4000000;
/* resolution must be a multiple of two */
......@@ -166,6 +168,9 @@ int main(int argc, char **argv) {
}
av_dump_format(oc, 0, "output.mkv", 1);
av_dict_set(&oc->metadata, "title", "Future Tech Lab Recording", 0);
av_dict_set(&oc->metadata, "artist", "University of Turku", 0);
if (avformat_write_header(oc, NULL) < 0) {
LOG(ERROR) << "Failed to write stream header";
}
......
......@@ -19,6 +19,7 @@ static constexpr uint8_t kFlagFlipRGB = 0x01; // Swap blue and red channels [de
static constexpr uint8_t kFlagMappedDepth = 0x02; // Use Yuv mapping for float [deprecated]
static constexpr uint8_t kFlagFloat = 0x04; // Floating point output
static constexpr uint8_t kFlagPartial = 0x10; // This frameset is not complete
static constexpr uint8_t kFlagStereo = 0x20; // Left-Right stereo in single channel
static constexpr uint8_t kFlagMultiple = 0x80; // Multiple video frames in single packet
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment