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.
This commit is contained in:
Karl Blomster 2009-03-30 22:09:33 +00:00
parent 6106546f74
commit 9bbf4c4281
5 changed files with 43 additions and 13 deletions

View file

@ -23,8 +23,6 @@
#include <stdint.h>
#define FFMS_EXPORTS
#ifdef __cplusplus
# define EXTERN_C extern "C"
#else

View file

@ -95,7 +95,7 @@ Opens files using ffmpeg and nothing else. May be frame accurate on good days. T
<p>
<b>cache:</b>
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.
</p>
<p>
@ -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.
</p>
<h2>Exported Avisynth variables</h2>
<p>
<b>FFSAR_NUM, FFSAR_DEN, FFSAR:</b>
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.
</p>
<p>
<b>FFCROP_LEFT, FFCROP_RIGHT, FFCROP_TOP, FFCROP_BOTTOM:</b>
The on playback cropping specified by the container.
</p>
<p>
<b>FFPICT_TYPE:</b>
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:
<pre>
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
</pre>
</p>
<h2>PP string format</h2>
<pre>
@ -190,10 +215,10 @@ tn:64:128:256
<p><b>FFmpeg svn</b> from http://ffmpeg.mplayerhq.hu/</p>
<p><b>Required FFmpeg Configuration:</b>
./configure --enable-memalign-hack --enable-gpl --enable-swscale --enable-postproc
./configure --enable-memalign-hack --enable-gpl --enable-postproc
<p><b>Suggested Additional Options:</b>
--enable-w32threads --disable-encoders --disable-muxers --disable-debug</p>
--enable-w32threads --disable-encoders --disable-muxers --disable-network --disable-debug</p>
<p>
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.
<h2>Changes</h2>
<ul>
<li>2.00 beta 5<ul>
<li>FFMSIndex should now print the progress properly when another application reads its output</li>
<li>Added missing variables and explanations to the manual</li>
<li>Can now directly be compiled as a library for use in *nix</li>
<li>Fixed the missing decimals in saved timecode files</li>
<li>Updated FFmpeg to rev 18249</li>
</ul></li>
<li>2.00 beta 4<ul>
<li>Added the function FFNoLog which suppresses all messages from ffmpeg</li>
<li>Experimental new TS parsing using Haali's splitter (with bugs)</li>

View file

@ -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.";
}

View file

@ -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;
}

View file

@ -25,7 +25,7 @@
#include "utils.h"
#include "ffms.h"
#define INDEXVERSION 11
#define INDEXVERSION 12
#define INDEXID 0x53920873
struct IndexHeader {