From 89c465dc71109c7f0d680c462c86c1d187116864 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Mon, 30 Mar 2009 22:09:33 +0000 Subject: [PATCH] FFmpegSource2 beta 5. Fixes a bug with timecode writing, adds some additional documentation and resolves the issue with reading ffmsindex's progress reporting from another program. Originally committed to SVN as r2768. --- aegisub/FFmpegSource2/ffms.h | 2 -- aegisub/FFmpegSource2/ffms2.html | 40 ++++++++++++++++++++++++++--- aegisub/FFmpegSource2/ffmsindex.cpp | 8 +++--- aegisub/FFmpegSource2/indexing.cpp | 4 +-- aegisub/FFmpegSource2/indexing.h | 2 +- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/aegisub/FFmpegSource2/ffms.h b/aegisub/FFmpegSource2/ffms.h index 18ff89d7d..efd813171 100644 --- a/aegisub/FFmpegSource2/ffms.h +++ b/aegisub/FFmpegSource2/ffms.h @@ -23,8 +23,6 @@ #include -#define FFMS_EXPORTS - #ifdef __cplusplus # define EXTERN_C extern "C" #else diff --git a/aegisub/FFmpegSource2/ffms2.html b/aegisub/FFmpegSource2/ffms2.html index e1da0a2ff..068e70818 100644 --- a/aegisub/FFmpegSource2/ffms2.html +++ b/aegisub/FFmpegSource2/ffms2.html @@ -95,7 +95,7 @@ Opens files using ffmpeg and nothing else. May be frame accurate on good days. T

cache: - Write indexing information to a file for later use. This setting does not control if The video index is loaded which it always is if it exists. + Write indexing information to a file for later use. This setting does not control if the video index is loaded which it always is if it exists.

@@ -138,6 +138,31 @@ Opens files using ffmpeg and nothing else. May be frame accurate on good days. T The colorspace to convert to. The names are YV12, YUY2, RGB24, RGB32 and the empty string for same as input.

+

Exported Avisynth variables

+

+FFSAR_NUM, FFSAR_DEN, FFSAR: + The playback aspect ratio specified by the container. FFSAR_NUM and FFSAR_DEN make up the rational number of the ratio and FFSAR is only provided for convenience. +

+ +

+FFCROP_LEFT, FFCROP_RIGHT, FFCROP_TOP, FFCROP_BOTTOM: + The on playback cropping specified by the container. +

+ +

+FFPICT_TYPE: + The picture type of the most recently requested frame. Use after_frame=true in Avisynth's conditional scripting for proper results. The FFmpeg source definition of the numbers: +

+FF_I_TYPE  1 ///< Intra
+FF_P_TYPE  2 ///< Predicted
+FF_B_TYPE  3 ///< Bi-dir predicted
+FF_S_TYPE  4 ///< S(GMC)-VOP MPEG4
+FF_SI_TYPE 5 ///< Switching Intra
+FF_SP_TYPE 6 ///< Switching Predicted
+FF_BI_TYPE 7
+
+

+

PP string format

@@ -190,10 +215,10 @@ tn:64:128:256
 

FFmpeg svn from http://ffmpeg.mplayerhq.hu/

Required FFmpeg Configuration: -./configure --enable-memalign-hack --enable-gpl --enable-swscale --enable-postproc +./configure --enable-memalign-hack --enable-gpl --enable-postproc

Suggested Additional Options: ---enable-w32threads --disable-encoders --disable-muxers --disable-debug

+--enable-w32threads --disable-encoders --disable-muxers --disable-network --disable-debug

Note that --enable-w32threads is required for multithreaded decoding to work. @@ -201,6 +226,15 @@ Note that --enable-w32threads is required for multithreaded decoding to work.

Changes

    +
  • 2.00 beta 5
      +
    • FFMSIndex should now print the progress properly when another application reads its output
    • +
    • Added missing variables and explanations to the manual
    • +
    • Can now directly be compiled as a library for use in *nix
    • +
    • Fixed the missing decimals in saved timecode files
    • +
    • Updated FFmpeg to rev 18249
    • +
  • + +
  • 2.00 beta 4
    • Added the function FFNoLog which suppresses all messages from ffmpeg
    • Experimental new TS parsing using Haali's splitter (with bugs)
    • diff --git a/aegisub/FFmpegSource2/ffmsindex.cpp b/aegisub/FFmpegSource2/ffmsindex.cpp index 2ae9252e0..64ab49953 100644 --- a/aegisub/FFmpegSource2/ffmsindex.cpp +++ b/aegisub/FFmpegSource2/ffmsindex.cpp @@ -125,7 +125,7 @@ static int FFMS_CC UpdateProgress(int State, int64_t Current, int64_t Total, voi else cout << "\b\b\b"; */ - cout << "Indexing, please wait... " << Percentage << "% \r"; + cout << "Indexing, please wait... " << Percentage << "% \r" << flush; return 0; } @@ -138,7 +138,7 @@ void DoIndexing () { Index = FFMS_ReadIndex(CacheFile.c_str(), FFMSErrMsg, MsgSize); if (Overwrite || Index == NULL) { - std::cout << "Indexing, please wait... 0% \r"; + std::cout << "Indexing, please wait... 0% \r" << std::flush; Index = FFMS_MakeIndex(InputFile.c_str(), TrackMask, DumpMask, AudioFile.c_str(), IgnoreErrors, UpdateProgress, &Progress, FFMSErrMsg, MsgSize); if (Index == NULL) { std::string Err = "\nIndexing error: "; @@ -147,7 +147,7 @@ void DoIndexing () { } if (Progress != 100) - std::cout << "Indexing, please wait... 100% \r"; + std::cout << "Indexing, please wait... 100% \r" << std::flush; std::cout << std::endl << "Writing index... "; @@ -157,7 +157,7 @@ void DoIndexing () { throw Err; } - std::cout << "done." << std::endl; + std::cout << "done." << std::endl << std::flush; } else { throw "Error: index file already exists, use -f if you are sure you want to overwrite it."; } diff --git a/aegisub/FFmpegSource2/indexing.cpp b/aegisub/FFmpegSource2/indexing.cpp index 474bd60fe..270d8a92a 100644 --- a/aegisub/FFmpegSource2/indexing.cpp +++ b/aegisub/FFmpegSource2/indexing.cpp @@ -749,7 +749,7 @@ int FrameInfoVector::WriteTimecodes(const char *TimecodeFile, char *ErrorMsg, un Timecodes << "# timecode format v2\n"; for (iterator Cur=begin(); Cur!=end(); Cur++) - Timecodes << (int64_t)((Cur->DTS * TB.Num) / (double)TB.Den) << "\n"; + Timecodes << ((Cur->DTS * TB.Num) / (double)TB.Den) << "\n"; return 0; } @@ -772,8 +772,6 @@ int FrameInfoVector::ClosestFrameFromDTS(int64_t DTS) { } } - //int64_t tmp = at(2).DTS - at(1).DTS; - //ATLASSERT(BestDiff == 0); return Frame; } diff --git a/aegisub/FFmpegSource2/indexing.h b/aegisub/FFmpegSource2/indexing.h index a963e5681..1a5978ab2 100644 --- a/aegisub/FFmpegSource2/indexing.h +++ b/aegisub/FFmpegSource2/indexing.h @@ -25,7 +25,7 @@ #include "utils.h" #include "ffms.h" -#define INDEXVERSION 11 +#define INDEXVERSION 12 #define INDEXID 0x53920873 struct IndexHeader {