- Notifications
You must be signed in to change notification settings - Fork50
Fix: different frame size as inputs of the filter graph#303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Let the filter managing the output frame size, using its internalframe buffer queue.
Used as frame buffers on the filter graph inputs.For the moment, this first version only handles audio frames.
Returning frames with the same size as inputs of the graph,avoiding to overflow the internal filter buffers.
If the input frames have the same size and the buffers are empty, bypassto avoid useless data copies.
private: | ||
void popFrame(); | ||
const AudioFrameDesc _audioFrameDesc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It seems that you have a compilation error because this attribute isconst...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, thanks! Now, it's fixed in380f238
Add a new getAvailableFrameSize() private method
Add utility methods, documentation and logs into FilterGraphand FrameBuffer classes
Avoid filling the filter graph buffers with wrong data frames.Improve documentation into FilterGraph::FrameBuffer class.
Since video frames cannot be split, this filter graph bufferswill be specialized to audio frames.
Replace it by a simple AudioFrameBuffer vector empty() test, sincebuffers are initialized only for audio frames (into the addInBuffer()method)And rename _inputAudioFramesBuffer attribute to _inputAudioFrameBuffers
coveralls commentedSep 7, 2017
Comparing the frame sizes in samples (instead of bytes)
Audio channels are extracted from different file format sources, tostereo and 5.1 output audio streams.
coveralls commentedSep 9, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
1 similar comment
coveralls commentedSep 9, 2017
coveralls commentedSep 9, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
1 similar comment
coveralls commentedSep 9, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
coveralls commentedSep 9, 2017
Export AudioFrameBuffer class symbol for DLL
coveralls commentedSep 11, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
1 similar comment
coveralls commentedSep 11, 2017
test/pyTest/testMuxAudioChannels.py Outdated
dst_inputFile = av.InputFile(outputFileName) | ||
dst_audioProperties = dst_inputFile.getProperties().getAudioProperties() | ||
assert_equals(1, len(dst_audioProperties)) | ||
assert_equals(2, dst_audioProperties[0].getNbChannels()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you check the duration of the output stream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actually, it was already done using the process statistics, but it is indeed better using the output file properties:9abcb90
test/pyTest/testMuxAudioChannels.py Outdated
dst_inputFile = av.InputFile(outputFileName) | ||
dst_audioProperties = dst_inputFile.getProperties().getAudioProperties() | ||
assert_equals(1, len(dst_audioProperties)) | ||
assert_equals(6, dst_audioProperties[0].getNbChannels()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you check the duration of the output stream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Duration check using the output file properties:9abcb90
if(!_filterGraph->hasFilters() || !_filterGraph->hasBufferedFrames(index)) | ||
{ | ||
continueProcess = false; | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Did you consider to userbreak instead ofcontinue? Because in this case, do we need to continue to get the remaining buffers in the filter graph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sure, it is better! See0e49751
Into audio channels muxing tests
…cess won't be continued
coveralls commentedSep 20, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
2 similar comments
coveralls commentedSep 20, 2017
coveralls commentedSep 20, 2017
@cchampet RTM? |
// Concatenate frames data | ||
size_t extractedDataSize = 0; | ||
unsigned char* outputData = new unsigned char[size]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is this type mean that the supported data type is only 1byte per sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No, it is actually the raw data in bytes, without considering the sample format or whatever.
@valnoel I had only one question. |
@cchampet OK then! :) |
Uh oh!
There was an error while loading.Please reload this page.
In order to mux audio channels, AvTranscoder uses theamerge filter.
If, as inputs of the filter graph containing thisamerge filter, we put frames with different sizes, the resulting frame size seems to be the minimum of the input frame size. This means that one or more output channels can have cut frames, changing the reading speed and generating clicks into the final audio stream.
Using the internal filter buffer, the output frame is ensured not to lose audio samples, solving the problem of speed and clicks.
However, the filter internal buffer is quiet limited and quickly overflowed, making the process crashing before the end of the program. So, using custom frame buffers before the filter graph inputs fixes this other problem.