-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_event_samples.cpp
62 lines (46 loc) · 1.22 KB
/
print_event_samples.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
Supplementary software media ingest specification:
https://github.com/unifiedstreaming/fmp4-ingest
Copyright (C) 2009-2021 CodeShop B.V.
http://www.code-shop.com
******************************************************************************/
#include "fmp4stream.h"
#include "event_track.h"
#include <iostream>
#include <fstream>
#include <memory>
using namespace fmp4_stream;
using namespace std;
extern string moov_64_enc;
void print_info()
{
std::cout << "*** prints the samples of event message track ***" << std::endl;
}
int main(int argc, char *argv[])
{
event_track::ingest_event_stream ingest_stream;
string out_file = "out_mpd_event.mpd";
string urn;
if (argc > 1)
{
ifstream input(argv[1], ifstream::binary);
if (!input.good())
{
cout << "failed loading input file: " << string(argv[1]) << endl;
print_info();
return 0;
}
cout << " reading input file: " << string(argv[1]) << std::endl;
if (argc > 2)
out_file = string(argv[2]);
// cmfv, cmfa files containing emsg boxes
ingest_stream.print_samples_from_file(input, false);
input.close();
return 0;
}
else
{
print_info();
}
return 0;
}