Working Smooth? Timestamps x 10.000

This commit is contained in:
Erik Zandvliet 2012-10-30 11:15:51 +01:00 committed by Thulinma
parent df6ea8eb0d
commit fff7cf9733
4 changed files with 77 additions and 32 deletions

View file

@ -8,6 +8,7 @@
#include <cstdlib>
#include <cstdio>
#include <string.h>
#include <fstream>
#include <unistd.h>
#include <signal.h>
#include <mist/flv_tag.h> //FLV support
@ -18,10 +19,20 @@ int main(int argc, char ** argv) {
Util::Config conf = Util::Config(argv[0], PACKAGE_VERSION);
conf.parseArgs(argc, argv);
FLV::Tag FLV_in; // Temporary storage for incoming FLV data.
std::ofstream vData( "vData" );
std::ofstream aData( "aData" );
while (!feof(stdin)){
if (FLV_in.FileLoader(stdin)){
std::cout << "Tag: " << FLV_in.tagType() << "\n\tTime: " << FLV_in.tagTime() << std::endl;
if( FLV_in.data[0] == 0x08 ) {//Audio
aData.write( FLV_in.data + 13, FLV_in.len - 17 );
}
if( FLV_in.data[0] == 0x09 ) {//Video
vData.write( FLV_in.data + 16, FLV_in.len - 20 );
}
}
}
vData.close();
aData.close();
return 0;
}

View file

@ -23,6 +23,12 @@ int main(int argc, char ** argv) {
MP4::Box mp4data;
while (mp4data.read(temp)){
std::cerr << mp4data.toPrettyString(0) << std::endl;
if( mp4data.isType( "mdat" ) ) {
std::ofstream oFile;
oFile.open( "mdat" );
oFile << std::string( mp4data.payload(), mp4data.payloadSize() );
oFile.close();
}
}
return 0;
}