Mp4Tag.cpp
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:3k
- /*****************************************************************
- |
- | AP4 - MP4 File Tagger
- |
- | Copyright 2002-2003 Gilles Boccon-Gibod
- |
- |
- | This file is part of Bento4/AP4 (MP4 Atom Processing Library).
- |
- | Unless you have obtained Bento4 under a difference license,
- | this version of Bento4 is Bento4|GPL.
- | Bento4|GPL is free software; you can redistribute it and/or modify
- | it under the terms of the GNU General Public License as published by
- | the Free Software Foundation; either version 2, or (at your option)
- | any later version.
- |
- | Bento4|GPL is distributed in the hope that it will be useful,
- | but WITHOUT ANY WARRANTY; without even the implied warranty of
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- | GNU General Public License for more details.
- |
- | You should have received a copy of the GNU General Public License
- | along with Bento4|GPL; see the file COPYING. If not, write to the
- | Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- | 02111-1307, USA.
- |
- ****************************************************************/
- /*----------------------------------------------------------------------
- | includes
- +---------------------------------------------------------------------*/
- #include <stdio.h>
- #include <stdlib.h>
- #include "Ap4.h"
- #include "Ap4FileByteStream.h"
- #include "Ap4Atom.h"
- #include "Ap4File.h"
- /*----------------------------------------------------------------------
- | constants
- +---------------------------------------------------------------------*/
- #define BANNER "MP4 File Tagger - Version 0.1an"
- "(c) 2002-2005 Gilles Boccon-Gibod & Julien Boeuf"
-
- /*----------------------------------------------------------------------
- | PrintUsageAndExit
- +---------------------------------------------------------------------*/
- static void
- PrintUsageAndExit()
- {
- fprintf(stderr,
- BANNER
- "nnusage: mp4tag [options] <input> <output>n");
- exit(1);
- }
- /*----------------------------------------------------------------------
- | main
- +---------------------------------------------------------------------*/
- int
- main(int argc, char** argv)
- {
- if (argc < 3) {
- PrintUsageAndExit();
- }
-
- AP4_ByteStream* input =
- new AP4_FileByteStream(argv[1],
- AP4_FileByteStream::STREAM_MODE_READ);
- AP4_ByteStream* output =
- new AP4_FileByteStream(argv[2],
- AP4_FileByteStream::STREAM_MODE_WRITE);
- AP4_File* file = new AP4_File(*input);
- //file->Write(output);
-
- printf("Successfully wrote %s in %sn", argv[1], argv[2]);
- delete file;
- delete input;
- delete output;
- return 0;
- }