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

ffmpeginput #1288

Closed
wants to merge 2 commits into from
Closed

ffmpeginput #1288

wants to merge 2 commits into from

Conversation

fafik23
Copy link
Contributor

@fafik23 fafik23 commented Dec 10, 2015

FIX ffmpeginput to read all frame. Tested with ffmpeg-2.8.1

@@ -206,29 +213,31 @@ FFmpegInput::open (const std::string &name, ImageSpec &spec)
!strcmp (m_codec_context->codec->name, "dvvideo")) {
m_offset_time = false;
}

m_codec_cap_delay=m_codec_context->codec->capabilities&AV_CODEC_CAP_DELAY ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the version of ffmpeg on one of my systems, AV_CODEC_CAP_DELAY is not found.

But there is a CODEC_CAP_DELAY. Are they the same, and I'm using a slightly older version, after which the AV_ was prepended?

do you think it's sufficient if I just add something like:

#ifndef AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY CODEC_CAP_DELAY
#endif 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can swich AV_CODEC_CAP_DELAY to CODEC_CAP_DELAY.
https://ffmpeg.org/doxygen/2.8/libavcodec_2avcodec_8h_source.html#l01064

2015-12-10 19:08 GMT+01:00 Larry Gritz notifications@github.com:

In src/ffmpeg.imageio/ffmpeginput.cpp
#1288 (comment):

@@ -206,29 +213,31 @@ FFmpegInput::open (const std::string &name, ImageSpec &spec)
!strcmp (m_codec_context->codec->name, "dvvideo")) {
m_offset_time = false;
}
+

  • m_codec_cap_delay=m_codec_context->codec->capabilities&AV_CODEC_CAP_DELAY ;

In the version of ffmpeg on one of my systems, AV_CODEC_CAP_DELAY is not
found.

But there is a CODEC_CAP_DELAY. Are they the same, and I'm using a
slightly older version, after which the AV_ was prepended?

do you think it's sufficient if I just add something like:

#ifndef AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY CODEC_CAP_DELAY
#endif


Reply to this email directly or view it on GitHub
https://github.com/OpenImageIO/oiio/pull/1288/files#r47261475.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll make that change as part of the merge.

@lgritz
Copy link
Collaborator

lgritz commented Dec 10, 2015

Can you explain briefly what problem this addresses? Is this related to issue #1003? Or is it something else?

@fafik23
Copy link
Contributor Author

fafik23 commented Dec 11, 2015

first it resolved problem with codec AV_CODEC_CAP_DELAY
http://www.ffmpeg.org/doxygen/2.8/group__lavc__decoding.html#ga99ee61b6dcffb7817a275d39da58cc74

second i remove condition to run avcodec_decode_video2 this make that we
put to codec only frame with pts >= pts we looking thats why we see only
key frames.
if (current_pos >= m_subimage) {
avcodec_decode_video2 (m_codec_context, m_frame, &finished, &pkt)
}

Last I add if( current_frame == frame && finished) to be sure we display
exactly this frame we need (current_frame is take from m_frame->pkt_pts
http://www.ffmpeg.org/doxygen/2.8/structAVFrame.html#a47f555732f9c18928de727a163cd7cb6
). this can make infinity loop when something go wrong.

I have not tested this on codec with bi-directional frame.

2015-12-10 19:40 GMT+01:00 Larry Gritz notifications@github.com:

Can you explain briefly what problem this addresses? Is this related to
issue #1003 #1003? Or is it
something else?


Reply to this email directly or view it on GitHub
#1288 (comment).

@lgritz
Copy link
Collaborator

lgritz commented Dec 11, 2015

Thanks, I'll add that to the commit message before I merge.

@lgritz
Copy link
Collaborator

lgritz commented Dec 11, 2015

Merged into master, with the fix described above and also a few very small formatting changes.

I'll eventually merge this into RB-1.6, but we're trying to lock it down for a release right now, so I don't want to merge it there until after the beta is over and a release is tagged. That will also give people a little while to test this further in master.

@lgritz lgritz closed this Dec 11, 2015
@lgritz lgritz mentioned this pull request Jan 3, 2019
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 this pull request may close these issues.

2 participants