Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
valnoel merged 18 commits intoavTranscoder:developfromvalnoel:filter_inputMethod
Sep 21, 2017

Conversation

valnoel
Copy link
Member

@valnoelvalnoel commentedAug 31, 2017
edited
Loading

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.

Let the filter managing the output frame size, using its internalframe buffer queue.
@valnoelvalnoel changed the titleFix: different frame size as inputs of the filter graph[WIP] Fix: different frame size as inputs of the filter graphSep 5, 2017
Valentin NOEL added4 commitsSeptember 5, 2017 16:43
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;
Copy link
Member

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...

Copy link
MemberAuthor

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

Valentin NOEL added6 commitsSeptember 6, 2017 12:03
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
Copy link

Coverage Status

Coverage decreased (-1.2%) to 76.929% when pulling969c6c3 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

Valentin NOEL added4 commitsSeptember 8, 2017 10:43
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.
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@avTranscoderavTranscoder deleted a comment fromcoverallsSep 8, 2017
@coveralls
Copy link

coveralls commentedSep 9, 2017
edited
Loading

Coverage Status

Coverage decreased (-1.5%) to 76.616% when pulling2dcdc1c on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 76.616% when pulling2dcdc1c on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

@coveralls
Copy link

coveralls commentedSep 9, 2017
edited
Loading

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling343ef4e on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

1 similar comment
@coveralls
Copy link

coveralls commentedSep 9, 2017
edited
Loading

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling343ef4e on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling343ef4e on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

@valnoelvalnoel changed the title[WIP] Fix: different frame size as inputs of the filter graphFix: different frame size as inputs of the filter graphSep 11, 2017
@valnoelvalnoel changed the titleFix: different frame size as inputs of the filter graph[WIP] Fix: different frame size as inputs of the filter graphSep 11, 2017
Export AudioFrameBuffer class symbol for DLL
@valnoelvalnoel changed the title[WIP] Fix: different frame size as inputs of the filter graphFix: different frame size as inputs of the filter graphSep 11, 2017
@coveralls
Copy link

coveralls commentedSep 11, 2017
edited
Loading

Coverage Status

Coverage increased (+0.5%) to 78.68% when pullinga26bae9 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 78.68% when pullinga26bae9 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

dst_inputFile = av.InputFile(outputFileName)
dst_audioProperties = dst_inputFile.getProperties().getAudioProperties()
assert_equals(1, len(dst_audioProperties))
assert_equals(2, dst_audioProperties[0].getNbChannels())
Copy link
Member

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?

Copy link
MemberAuthor

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

dst_inputFile = av.InputFile(outputFileName)
dst_audioProperties = dst_inputFile.getProperties().getAudioProperties()
assert_equals(1, len(dst_audioProperties))
assert_equals(6, dst_audioProperties[0].getNbChannels())
Copy link
Member

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?

Copy link
MemberAuthor

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;
Copy link
Member

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?

Copy link
MemberAuthor

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

@coveralls
Copy link

coveralls commentedSep 20, 2017
edited
Loading

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling0e49751 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling0e49751 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 78.68% when pulling0e49751 on valnoel:filter_inputMethod into93961f4 on avTranscoder:develop.

@valnoel
Copy link
MemberAuthor

@cchampet RTM?


// Concatenate frames data
size_t extractedDataSize = 0;
unsigned char* outputData = new unsigned char[size];
Copy link
Member

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?

Copy link
MemberAuthor

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.

@cchampet
Copy link
Member

@valnoel I had only one question.
Except that, you can merge whenever you want ;)

@valnoel
Copy link
MemberAuthor

@cchampet OK then! :)

@valnoelvalnoel merged commitd33ffd2 intoavTranscoder:developSep 21, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@cchampetcchampetcchampet left review comments

Assignees

@cchampetcchampet

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@valnoel@coveralls@cchampet

[8]ページ先頭

©2009-2025 Movatter.jp