mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
* fixes #2729 * don't commit vscode stuff * Update ffmpeg_utils.h typo --------- Co-authored-by: pf <pf@me>
This commit is contained in:
parent
e006bfe5e8
commit
dc94754607
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@ docs/docs/git-logs.xml
|
||||
docs/docs/python/classes.txt
|
||||
docs/docs/python/functions.txt
|
||||
docs/docs/python/constants.txt
|
||||
**/.vscode
|
||||
|
@ -802,7 +802,14 @@ namespace dlib
|
||||
f->format = h > 0 && w > 0 ? (int)pixfmt : (int)samplefmt;
|
||||
timestamp = timestamp_;
|
||||
|
||||
int ret = av_frame_get_buffer(f.get(), 0); //use default alignment, which is likely 32
|
||||
// The ffmpeg documentation recommends you always use align==0.
|
||||
// However, in ffmpeg 3.2, there is a bug where if you do that, data buffers don't get allocated.
|
||||
// So workaround is to manually set align==32
|
||||
// Not ideal, but i've checked the source code in ffmpeg 3.3, 4.4 and 5.0 libavutil/frame.c
|
||||
// and in every case, if align==0, then align=32
|
||||
const int align = 32;
|
||||
|
||||
const int ret = av_frame_get_buffer(f.get(), align);
|
||||
if (ret < 0)
|
||||
{
|
||||
f = nullptr;
|
||||
@ -1135,7 +1142,7 @@ namespace dlib
|
||||
f.height(),
|
||||
1);
|
||||
|
||||
DLIB_ASSERT(ret == expsize, "av_image_copy_to_buffer() error : " << details::get_av_error(ret));
|
||||
DLIB_ASSERT(ret == (int)expsize, "av_image_copy_to_buffer() error : " << details::get_av_error(ret));
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ try
|
||||
}
|
||||
|
||||
const std::string filepath = get_option(parser, "i", "");
|
||||
const std::string codec = get_option(parser, "codec", "");
|
||||
const std::string codec = get_option(parser, "codec", "h264");
|
||||
|
||||
image_window win;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user