summaryrefslogtreecommitdiff
path: root/rotord/rotor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rotor.cpp')
-rwxr-xr-xrotord/rotor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 2da6a8b..e0c91dd 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -256,7 +256,7 @@ Command_response Render_context::session_command(const std::vector<std::string>&
if (state==IDLE) {
output_filename=command[3];
if (command.size()>3) {
- output_framerate=ofToFloat(command[4]);
+// output_framerate=ofToFloat(command[4]);
}
add_queue(RENDER);
response.status=HTTPResponse::HTTP_OK;
@@ -378,7 +378,7 @@ bool Render_context::load_audio(const string &filename,vector<Base_audio_process
{
// Try to decode the packet into a frame
int frameFinished = 0;
- //int bytes =
+ //int bytes =
avcodec_decode_audio4(codecContext, frame, &frameFinished, &packet);
// Some frames rely on multiple packets, so we have to make sure the frame is finished before
@@ -635,7 +635,7 @@ bool Video_output::render(const float duration, const float framerate,const stri
uint8_t *outbuf, *picture_buf;
cerr << "Rotor: rendering " << output_filename << " , " << duration << " seconds at " << framerate << " frames per second" << endl;
-
+
/* find the mpeg1 video encoder */
codec = avcodec_find_encoder(AV_CODEC_ID_H264);
if (!codec) {
@@ -650,14 +650,15 @@ bool Video_output::render(const float duration, const float framerate,const stri
c->bit_rate = 400000;
/* resolution must be a multiple of two */
c->width = 640;
- c->height = 250;
+ c->height = 480;
/* frames per second */
c->time_base= (AVRational){1,25};
c->gop_size = 10; /* emit one intra frame every ten frames */
c->max_b_frames=1;
c->pix_fmt = PIX_FMT_YUV420P; //AV_PIX_FMT_RGB24
- AVDictionary *options;
+ AVDictionary *options; //= NULL; causes a forward declaration error!?
+ options=NULL;
/* open it */
if (avcodec_open2(c, codec, &options) < 0) {
@@ -685,7 +686,7 @@ bool Video_output::render(const float duration, const float framerate,const stri
picture->linesize[2] = c->width / 2;
/* encode 1 second of video */
- for(i=0;i<25;i++) {
+ for(i=0;i<250;i++) {
fflush(stdout);
/* prepare a dummy image */
/* Y */
@@ -728,10 +729,11 @@ bool Video_output::render(const float duration, const float framerate,const stri
free(picture_buf);
free(outbuf);
+
avcodec_close(c);
av_free(c);
av_free(picture);
printf("\n");
return true;
-} \ No newline at end of file
+}