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

Strange "noise points"? #243

Closed
yiyuezhuo opened this issue Jun 10, 2020 · 2 comments · Fixed by #245
Closed

Strange "noise points"? #243

yiyuezhuo opened this issue Jun 10, 2020 · 2 comments · Fixed by #245

Comments

@yiyuezhuo
Copy link
Contributor

I found that read generates some "noise points" in the right region. More weirdly, it gives different results on Windows and Linux.

ffmpeg result (reference, both on Windows and Linux):

image

VideoIO on linux:
image

VideoIO on Windows:
image

Test video:
https://drive.google.com/file/d/1ThCzT_1PMkspxAktCY1bkvFFsG_IsNHc/view?usp=sharing

ffmpeg command:

ffmpeg -i out.mp4 frame%04d.png

VideoIO script:

using VideoIO
using FileIO

function fmt(x)
    s = string(x)
    "0"^(4-length(s)) * s
end

function split_frame(fname)
    io = VideoIO.open(fname)

    f = VideoIO.openvideo(io)

    img = read(f)

    let i=1
        while !eof(f)
            save("frame" * fmt(i) * ".png", img)
            i += 1
            read!(f, img)
        end
        save("frame" * fmt(i) * ".png", img)
    end
end

split_frame("out.mp4")

Do I need some extra options to avoid this? Or is there a "standard" format to make VideoIO work without such problems (The test video self is generated by ffmpeg with default parameter.)?

@yiyuezhuo
Copy link
Contributor Author

I had a hard time to debug this and figure it out that it's due to avpicture deprecated problem (also see SO quesion). I compared VideoIO with PyAV, which returned the correct result, and finally got a solution. Maybe I will create a pull request to fix this, but it's not that minor though.

@IanButterworth
Copy link
Member

A PR would be very welcome!

yiyuezhuo added a commit to yiyuezhuo/VideoIO.jl that referenced this issue Jun 17, 2020
IanButterworth pushed a commit that referenced this issue Jun 29, 2020
* Try to introduce align to fix issue #243

* replace per cell copy with per fow copy

* add desc and word size

* add missing sws_context free part

* swap two collection statements and empty stream_contexts

* add unit tests for c api memory leak

* skip memory leak test except linux

* fix memory leak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants