Changeset 7408 in vbox for trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture
- Timestamp:
- Mar 10, 2008 2:45:46 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28841
- Location:
- trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.cpp
r7400 r7408 27 27 #include <png.h> 28 28 #include <iprt/stream.h> 29 30 //#define VBOX_SHOW_AVAILABLE_FORMATS 29 31 30 32 // external constructor for dynamic loading … … 702 704 AVOutputFormat *pOutFormat = guess_format(0, com::Utf8Str(mFileName), 703 705 0); 706 #ifdef VBOX_SHOW_AVAILABLE_FORMATS 707 if (!pOutFormat) 708 { 709 RTPrintf("Could not guess an output format for that extension.\n" 710 "Available formats:\n"); 711 list_formats(); 712 } 713 #endif 704 714 AssertMsgReturn(pOutFormat != 0, 705 715 ("Could not deduce output format from file name\n"), … … 730 740 731 741 742 HRESULT FFmpegFB::list_formats() 743 { 744 AVCodec *codec; 745 for (codec = first_avcodec; codec != NULL; codec = codec->next) 746 { 747 if (codec->type == CODEC_TYPE_VIDEO && codec->encode) 748 { 749 AVOutputFormat *ofmt; 750 for (ofmt = first_oformat; ofmt != NULL; ofmt = ofmt->next) 751 { 752 if (ofmt->video_codec == codec->id) 753 RTPrintf(" %20s: %20s => '%s'\n", codec->name, ofmt->extensions, ofmt->long_name); 754 } 755 } 756 } 757 } 758 759 732 760 /** 733 761 * Open the FFmpeg codec and set it up (width, etc) for our MPEG file. … … 746 774 AssertReturn(pCodecContext != 0, E_UNEXPECTED); 747 775 AVCodec *pCodec = avcodec_find_encoder(pOutFormat->video_codec); 776 #ifdef VBOX_SHOW_AVAILABLE_FORMATS 777 if (!pCodec) 778 { 779 RTPrintf("Could not find a suitable codec for the output format on your system\n" 780 "Available formats:\n"); 781 list_formats(); 782 } 783 #endif 748 784 AssertReturn(pCodec != 0, E_UNEXPECTED); 749 785 pCodecContext->codec_id = pOutFormat->video_codec; -
trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.h
r7400 r7408 173 173 HRESULT setup_library(); 174 174 HRESULT setup_output_format(); 175 HRESULT list_formats(); 175 176 HRESULT open_codec(); 176 177 HRESULT open_output_file();
Note:
See TracChangeset
for help on using the changeset viewer.