Mp4Tag.cpp
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:3k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*****************************************************************
  2. |
  3. |    AP4 - MP4 File Tagger
  4. |
  5. |    Copyright 2002-2003 Gilles Boccon-Gibod
  6. |
  7. |
  8. |    This file is part of Bento4/AP4 (MP4 Atom Processing Library).
  9. |
  10. |    Unless you have obtained Bento4 under a difference license,
  11. |    this version of Bento4 is Bento4|GPL.
  12. |    Bento4|GPL is free software; you can redistribute it and/or modify
  13. |    it under the terms of the GNU General Public License as published by
  14. |    the Free Software Foundation; either version 2, or (at your option)
  15. |    any later version.
  16. |
  17. |    Bento4|GPL is distributed in the hope that it will be useful,
  18. |    but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. |    GNU General Public License for more details.
  21. |
  22. |    You should have received a copy of the GNU General Public License
  23. |    along with Bento4|GPL; see the file COPYING.  If not, write to the
  24. |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  25. |    02111-1307, USA.
  26. |
  27.  ****************************************************************/
  28. /*----------------------------------------------------------------------
  29. |       includes
  30. +---------------------------------------------------------------------*/
  31. #include <stdio.h>
  32. #include <stdlib.h>
  33. #include "Ap4.h"
  34. #include "Ap4FileByteStream.h"
  35. #include "Ap4Atom.h"
  36. #include "Ap4File.h"
  37. /*----------------------------------------------------------------------
  38. |       constants
  39. +---------------------------------------------------------------------*/
  40. #define BANNER "MP4 File Tagger - Version 0.1an"
  41.                "(c) 2002-2005 Gilles Boccon-Gibod & Julien Boeuf"
  42.  
  43. /*----------------------------------------------------------------------
  44. |       PrintUsageAndExit
  45. +---------------------------------------------------------------------*/
  46. static void
  47. PrintUsageAndExit()
  48. {
  49.     fprintf(stderr, 
  50.             BANNER 
  51.             "nnusage: mp4tag [options] <input> <output>n");
  52.     exit(1);
  53. }
  54. /*----------------------------------------------------------------------
  55. |       main
  56. +---------------------------------------------------------------------*/
  57. int
  58. main(int argc, char** argv)
  59. {
  60.     if (argc < 3) {
  61.         PrintUsageAndExit();
  62.     }
  63.     
  64.     AP4_ByteStream* input = 
  65.         new AP4_FileByteStream(argv[1],
  66.                                AP4_FileByteStream::STREAM_MODE_READ);
  67.     AP4_ByteStream* output =
  68.         new AP4_FileByteStream(argv[2],
  69.                                AP4_FileByteStream::STREAM_MODE_WRITE);
  70.     AP4_File* file = new AP4_File(*input);
  71.     //file->Write(output);
  72.     
  73.     printf("Successfully wrote %s in %sn", argv[1], argv[2]);
  74.     delete file;
  75.     delete input;
  76.     delete output;
  77.     return 0;
  78. }