Skip to content

Commit a956861

Browse files
author
Clement Champetier
committed
avprocessor: can add dummy video
* If dummy video, need a VideoDesc. * Warning: can't add a dummy audio, because we need an AudioDesc... Need to add this information in the confi file. Maybe it will be easier in python!
1 parent 4c34ad9 commit a956861

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

app/genericProcessor/genericProcessor.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#include <sstream>
99
#include <cstdlib>
1010

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+
1117
// bool verbose = false;
1218
bool verbose = true;
1319

@@ -47,9 +53,27 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
4753
std::cout << ( transcodeProfile.length() ? transcodeProfile : "rewrap" );
4854
std::cout << std::endl;
4955
}
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+
}
5377
}
5478
}
5579
}

0 commit comments

Comments
 (0)