Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
3f266677
Commit
3f266677
authored
Jun 08, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videoio: fix some issues in ffmpeg error processing
parent
959d5752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
cap_ffmpeg_impl.hpp
modules/videoio/src/cap_ffmpeg_impl.hpp
+9
-4
No files found.
modules/videoio/src/cap_ffmpeg_impl.hpp
View file @
3f266677
...
...
@@ -1739,7 +1739,7 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
/* find the video encoder */
codec
=
avcodec_find_encoder
(
c
->
codec_id
);
if
(
!
codec
)
{
fprintf
(
stderr
,
"Could not find encoder for codec id %d: %s"
,
c
->
codec_id
,
icvFFMPEGErrStr
(
fprintf
(
stderr
,
"Could not find encoder for codec id %d: %s
\n
"
,
c
->
codec_id
,
icvFFMPEGErrStr
(
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
AVERROR_ENCODER_NOT_FOUND
#else
...
...
@@ -1763,7 +1763,7 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
avcodec_open
(
c
,
codec
)
#endif
)
<
0
)
{
fprintf
(
stderr
,
"Could not open codec '%s': %s"
,
codec
->
name
,
icvFFMPEGErrStr
(
err
));
fprintf
(
stderr
,
"Could not open codec '%s': %s
\n
"
,
codec
->
name
,
icvFFMPEGErrStr
(
err
));
return
false
;
}
...
...
@@ -1967,6 +1967,13 @@ void OutputMediaStream_FFMPEG::close()
AVStream
*
OutputMediaStream_FFMPEG
::
addVideoStream
(
AVFormatContext
*
oc
,
CV_CODEC_ID
codec_id
,
int
w
,
int
h
,
int
bitrate
,
double
fps
,
PixelFormat
pixel_format
)
{
AVCodec
*
codec
=
avcodec_find_encoder
(
codec_id
);
if
(
!
codec
)
{
fprintf
(
stderr
,
"Could not find encoder for codec id %d
\n
"
,
codec_id
);
return
NULL
;
}
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 10, 0)
AVStream
*
st
=
avformat_new_stream
(
oc
,
0
);
#else
...
...
@@ -1998,8 +2005,6 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC
c
->
width
=
w
;
c
->
height
=
h
;
AVCodec
*
codec
=
avcodec_find_encoder
(
c
->
codec_id
);
// time base: this is the fundamental unit of time (in seconds) in terms
// of which frame timestamps are represented. for fixed-fps content,
// timebase should be 1/framerate and timestamp increments should be
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment