Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpegFrameFilter problem when multi filters #1268

Closed
varlxj opened this issue Aug 9, 2019 · 2 comments
Closed

FFmpegFrameFilter problem when multi filters #1268

varlxj opened this issue Aug 9, 2019 · 2 comments

Comments

@varlxj
Copy link

varlxj commented Aug 9, 2019

hello
this is what i want
ffplay test.mp4 -vf "drawbox=100:100:100:100:black@1,vflip"

the source video
image

right result
image

but when i use FFmpegFrameFilter, I can not get the same result

error result
image

FFmpegFrameFilter with sigle filter i can get correctly result, but when i use filterchain or filtergraph, the final result is always like this

this is my code:

FFmpegFrameFilter filter = new FFmpegFrameFilter("drawbox=100:100:100:100,vflip",  
 grabber.getImageWidth(), grabber.getImageHeight());  
filter.setFrameRate(grabber.getFrameRate());  
filter.start();  

while (true) {
    Frame frame = grabber.grabFrame();  
    if (frame == null) { 
        break;  
    } 

    if (frame.getTypes().contains(Frame.Type.VIDEO)) { 
        filter.push(frame); 
        frame = filter.pull(); 
    } 

    recorder.record(frame);  
} 

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>opencv</artifactId>
    <version>4.1.0-1.5.1</version>
    <classifier>macosx-x86_64</classifier> 
</dependency> 
<dependency> 
    <groupId>org.bytedeco</groupId>
    <artifactId>ffmpeg</artifactId>
    <version>4.1.3-1.5.1</version>
    <classifier>macosx-x86_64</classifier>
</dependency>
<dependency>
    <groupId>org.bytedeco</groupId> 
    <artifactId>javacv</artifactId> 
    <version>1.5.1</version> 
</dependency> 

thank you

@saudet
Copy link
Member

saudet commented Aug 9, 2019

The filters you're using probably don't support your pixel format and are converting it to something else. Make sure to convert it back to what you need with, for example, the format filter after.

@saudet
Copy link
Member

saudet commented Aug 9, 2019

Duplicate of #945

@saudet saudet marked this as a duplicate of #945 Aug 9, 2019
@saudet saudet closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants