diff options
| author | Comment <tim@gray.(none)> | 2013-10-01 03:46:02 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-10-01 03:46:02 +0100 |
| commit | 41eb154001909c7ade5973e61a4cc4389fe36538 (patch) | |
| tree | ae0c7aaf5d045b32d37d3f69eb3bb14b71b9ce98 | |
| parent | 3f59deabc6f14c64983aa681904217a676b1d882 (diff) | |
very painful debugging
| -rw-r--r-- | rotord/src/libavwrapper.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp index 1376d02..b39428a 100644 --- a/rotord/src/libavwrapper.cpp +++ b/rotord/src/libavwrapper.cpp @@ -141,7 +141,6 @@ bool libav::exporter::record(std::string filename){ // allocate the output media context // avformat_alloc_output_context2(&oc, NULL, NULL, filename.c_str()); - printf("exporter 2.\n"); if (!oc) { printf("Could not deduce output format from file extension: using MPEG.\n"); @@ -152,7 +151,6 @@ bool libav::exporter::record(std::string filename){ } fmt = oc->oformat; - printf("exporter 3.\n"); // Add the audio and video streams using the default format codecs // * and initialize the codecs. // @@ -160,6 +158,8 @@ bool libav::exporter::record(std::string filename){ audio_st = NULL; fmt->video_codec=AV_CODEC_ID_H264; //AV_CODEC_ID_MPEG4 + //fmt->audio_codec=AV_CODEC_MP3; //guessing, 011013 + if (fmt->video_codec != AV_CODEC_ID_NONE) { video_st = add_stream(oc, &video_codec, fmt->video_codec); @@ -169,7 +169,7 @@ bool libav::exporter::record(std::string filename){ audio_st = add_stream(oc, &audio_codec, fmt->audio_codec); } - printf("exporter 4.\n"); + //set initial video params video_st->codec->width=w; @@ -197,9 +197,12 @@ bool libav::exporter::record(std::string filename){ // Now that all the parameters are set, we can open the audio and // * video codecs and allocate the necessary encode buffers. // + printf("exporter 2.\n"); if (video_st) open_video(oc, video_codec, video_st); + printf("exporter 3.\n"); if (audio_st) { + printf("exporter 4.\n"); audioframesize=open_audio(oc, audio_codec, audio_st); audiostep=((float)audioframesize)/(audio_st->codec->sample_rate); std::cerr << "opened audio codec with "<<audioframesize<<" frame size and "<<audiostep<<" seconds per frame"<<std::endl; |
