|
8 | 8 | #include <sstream>
|
9 | 9 | #include <cstdlib>
|
10 | 10 |
|
| 11 | +static const size_t dummyWidth = 1920; |
| 12 | +static const size_t dummyHeight = 1080; |
| 13 | +static const std::string dummyPixelFormat = "yuv420p"; |
| 14 | +static const std::string dummyVideoCodec = "mpeg2video"; |
| 15 | +static const std::string dummyAudioCodec = "pcm_s16le"; |
| 16 | + |
11 | 17 | // bool verbose = false;
|
12 | 18 | bool verbose = true;
|
13 | 19 |
|
@@ -47,9 +53,27 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
|
47 | 53 | std::cout << ( transcodeProfile.length() ? transcodeProfile : "rewrap" );
|
48 | 54 | std::cout << std::endl;
|
49 | 55 | }
|
50 |
| - |
51 |
| - transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile ); |
52 |
| - |
| 56 | + |
| 57 | + // dummy stream, need a CodedDesc (audio or video) |
| 58 | + if( ! filename.length() ) |
| 59 | + { |
| 60 | + // video |
| 61 | + avtranscoder::VideoFrameDesc imageDesc; |
| 62 | + imageDesc.setWidth( dummyWidth ); |
| 63 | + imageDesc.setHeight( dummyHeight ); |
| 64 | + imageDesc.setDar( dummyWidth, dummyHeight ); |
| 65 | + avtranscoder::Pixel inputPixel( dummyPixelFormat ); |
| 66 | + imageDesc.setPixel( inputPixel ); |
| 67 | + |
| 68 | + avtranscoder::VideoDesc inputVideoDesc( dummyVideoCodec ); |
| 69 | + inputVideoDesc.setImageParameters( imageDesc ); |
| 70 | + |
| 71 | + transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoDesc ); |
| 72 | + } |
| 73 | + else |
| 74 | + { |
| 75 | + transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile ); |
| 76 | + } |
53 | 77 | }
|
54 | 78 | }
|
55 | 79 | }
|
|
0 commit comments