diff options
| author | Comment <tim@gray.(none)> | 2013-07-03 03:04:47 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-07-03 03:04:47 +0100 |
| commit | 379251337ac5806cf98047c3fc308d932b1aefab (patch) | |
| tree | 5ff932df86fec52543541129db7825a1c1e50934 | |
| parent | d77afa02389ecaf1858c94e80530345610907a28 (diff) | |
found a major bug in render timeline
| -rwxr-xr-x | rotord/libavwrapper.cpp | 2 | ||||
| -rwxr-xr-x | rotord/rotor.cpp | 6 | ||||
| -rwxr-xr-x | rotord/rotor.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/rotord/libavwrapper.cpp b/rotord/libavwrapper.cpp index 0142e8f..97315a6 100755 --- a/rotord/libavwrapper.cpp +++ b/rotord/libavwrapper.cpp @@ -368,7 +368,7 @@ bool libav::decoder::readNextFrameWithPacket(int targetFrameIndex, AVPacket& pac avpicture_fill( (AVPicture * ) pYuv, blank, pCtx->pix_fmt,width, height ); // set to blank frame finished = 1; } -#if 0 // very useful for debugging +#if 0 // very useful for debugging, very cout << "Packet - pts:" << (int)packet.pts; cout << " dts:" << (int)packet.dts; cout << " - flag: " << packet.flags; diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 33b8597..7985c40 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -294,7 +294,7 @@ bool Video_output::render(const float duration, const float framerate,const stri //[libx264 @ 0x7fffe8003940] 264 - core 123 r2189 35cf912 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=10 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 //Assertion ff_avcodec_locked failed at libavcodec/utils.c:2967 - + //cerr<<"videoloader: "<<vf<<" seconds, vstep "<<vstep<<" ,asking for frame "<<((int)((vf*framerate)+0.5))<<endl; Image* i=get_output(Frame_spec(vf,framerate,duration,outW,outH)); if (i) { @@ -380,13 +380,15 @@ Image* Video_loader::output(const Frame_spec &frame){ */ if (isLoaded){ - int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()); //-2?? this would give division by zero + int wanted=(((int) ((frame.time*frame.framerate)+0.5))%(player.getNumberOfFrames()))+1; //-2?? this would give division by zero //if (wanted==99){ // cerr<<"videoloader: near the end"<<endl; //} + //cerr<<"videoloader: getting frame "<<wanted<<endl; + if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; return nullptr; }; image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]); return ℑ diff --git a/rotord/rotor.h b/rotord/rotor.h index ae17e9a..92d6e45 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -1178,9 +1178,9 @@ namespace Rotor { }; class Graph{ public: - Graph(){duration=10.0f;loaded = false;outW=640;outH=360;}; + Graph(){duration=5.0f;loaded = false;outW=640;outH=360;}; Graph(const string& _uid,const string& _desc){init(_uid,_desc);}; - void init(const string& _uid,const string& _desc){ uid=_uid;description=_desc;duration=10.0f;}; + void init(const string& _uid,const string& _desc){ uid=_uid;description=_desc;duration=5.0f;}; string uid; //every version of a graph has a UUID, no particular need to actually read its data(?) //?? is it faster than using strings?? string description; |
