[FFmpeg-devel] [PATCH] avformat/fivdec: cached keyframes before video or audio stream was created

XinZheng Zhang zhangxzheng at gmail.com
Thu Jul 21 05:35:09 EEST 2016


I apologize about my English and let me re-arrange my words.
The current realization would result in the loss of all key frame
indices from all the current video frames,
which would lead to the failure of seeking in FLVs.
My current patch will cache all key frame indices without creating any
video streams,
and put in all those immediately after creating any relevant video streams.

I found that there has something error with my `egrep`,
caused all the patches (include applied patch) could not be checked
successfully.
The error message is same to the log which Steven Liu posted.
Here is my platform message:
    egrep (BSD grep) 2.5.1-FreeBSD
    osx 10.11.4


I will resend a new patch without the extra new line.

On Thu, Jul 21, 2016 at 7:39 AM, Steven Liu <lingjiujianke at gmail.com> wrote:
> 2016-07-21 7:29 GMT+08:00 Steven Liu <lingjiujianke at gmail.com>:
>
>>
>>
>> 2016-07-21 5:03 GMT+08:00 Moritz Barsnick <barsnick at gmx.net>:
>>
>>> On Thu, Jul 21, 2016 at 00:06:44 +0800, zhangxinzheng wrote:
>>>
>>> > Subject: [FFmpeg-devel] [PATCH] avformat/fivdec: cached keyframes
>>> before video or audio stream was created
>>>                                            ^^^ flv
>>>
>>> > There has an error when seeking in a flv file, which key frames was
>>> > sorted before video frame.
>>> > This ensures that all the key frames was cached, and add to
>>> > corresponding stream when it was created.
>>>
>>> Thanks to the grammar, I don't understand the intent of the patch.
>>> (Don't get me wrong, I'm not scorning your English, but it needs to be
>>> improved.)
>>>
>> Hi Moritz,
>> Perhaps he want to create a keyframe index for flv file, to seek flv
>> keyframe.
>>
>>
>>
>>> >  #define RESYNC_BUFFER_SIZE (1<<20)
>>> >
>>> > +
>>> > +typedef struct FLVKeyFrame {
>>>
>>> Why the extra newline?
>>
>>
>> Hi Zhang Xinzheng ,
>>
>>     You should check the patch use the tool at ./tools/patcheck .
>>      Please reading
>> http://ffmpeg.org/developer.html#toc-Submitting-patches-1 .
>>
> ok, I make a mistake, the patchcheck can not check the newline
>
>
>
> localhost:ffmpeg StevenLiu$ cat new_patch.patch | head -n 30
> ---
>  libavformat/flvdec.c | 52
> +++++++++++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 45 insertions(+), 7 deletions(-)
>
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 2bf1e05..8a73b68 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -30,6 +30,7 @@
>  #include "libavutil/opt.h"
>  #include "libavutil/intfloat.h"
>  #include "libavutil/mathematics.h"
> +#include "libavutil/mem.h"
>  #include "libavcodec/bytestream.h"
>  #include "libavcodec/mpeg4audio.h"
>  #include "avformat.h"
> @@ -41,6 +42,12 @@
>
>  #define RESYNC_BUFFER_SIZE (1<<20)
>
> +
> +typedef struct FLVKeyFrame {
> +    int64_t pos;
> +    int64_t timestamp;
> +} FLVKeyFrame;
> +
>  typedef struct FLVContext {
>      const AVClass *class; ///< Class for private options.
>      int trust_metadata;   ///< configure streams according onMetaData
> @@ -61,6 +68,10 @@ typedef struct FLVContext {
> localhost:ffmpeg StevenLiu$
> localhost:ffmpeg StevenLiu$ ./tools/patcheck new_patch.patch
> patCHeck 1e10.0
> This tool is intended to help a human check/review patches. It is very far
> from
> being free of false positives and negatives, and its output are just hints
> of what
> may or may not be bad. When you use it and it misses something or detects
> something wrong, fix it and send a patch to the ffmpeg-devel mailing list.
> License: GPL, Author: Michael Niedermayer
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> egrep: empty (sub)expression
> xargs: illegal option -- d
> usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
>              [-L number] [-n number [-x]] [-P maxprocs] [-s size]
>              [utility [argument ...]]
>
> Missing changelog entry (ignore if minor change)
> egrep: empty (sub)expression
> localhost:ffmpeg StevenLiu$
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list