Opened 2 years ago

Closed 2 years ago

#5729 closed defect (fixed)

FLV key frame index at start may be skipped

Reported by: snorlaxzxz Owned by:
Priority: important Component: avformat
Version: git-master Keywords: flv regression
Cc: zhangxzheng@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
keyframe in metadata will be dropped until the first video frame comes.

How to reproduce:

seek attatched file.

Attachments (1)

heheheh.flv (1.1 MB) - added by snorlaxzxz 2 years ago.

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by snorlaxzxz

comment:1 follow-ups: Changed 2 years ago by cehoyos

  • Keywords flv added; flvdec removed

Seeking works fine here for the uploaded sample.
Please provide the command line that allows to reproduce the issue together with the complete, uncut console output.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 2 years ago by snorlaxzxz

  • Cc zhangxzheng@gmail.com added
  • Summary changed from Failure of seeking in FLVs to FLV key frame index at start may be skipped

Replying to cehoyos:

Seeking works fine here for the uploaded sample.
Please provide the command line that allows to reproduce the issue together with the complete, uncut console output.

The issue was introduced since 09ae7b81ea. It may slow down seeking in online streams.

In flvdec.c 420

case AMF_DATA_TYPE_OBJECT:
    if ((vstream || astream) && key &&
        ioc->seekable &&
        !strcmp(KEYFRAMES_TAG, key) && depth == 1)
        if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
                                  max_pos) < 0)

If the first packet we got is object, both vstream and astream are NULL,
which may prevent keyframe index being parsed.

Eg. [meta:keyframe index]-[a]-[v]-[a]-[v]...

I have sent a patch to ML
avformat/fivdec: cached keyframes before video or audio stream was created

Last edited 2 years ago by snorlaxzxz (previous) (diff)

comment:3 in reply to: ↑ 1 Changed 2 years ago by snorlaxzxz

Replying to cehoyos:

Seeking works fine here for the uploaded sample.
Please provide the command line that allows to reproduce the issue together with the complete, uncut console output.

Sorry, the meta data in sample seems to be cutted. Please check it in original file.
https://drive.google.com/file/d/0B4mDLcW3R2feMjdYWk14XzduNjA/view?usp=sharing

comment:4 in reply to: ↑ description Changed 2 years ago by snorlaxzxz

Replying to snorlaxzxz:

Summary of the bug:
keyframe in metadata will be dropped until the first video frame comes.

How to reproduce:
seek attatched file.

https://drive.google.com/file/d/0B4mDLcW3R2feMjdYWk14XzduNjA/view?usp=sharing

comment:5 in reply to: ↑ 2 ; follow-up: Changed 2 years ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important

Replying to snorlaxzxz:

Replying to cehoyos:

Seeking works fine here for the uploaded sample.
Please provide the command line that allows to reproduce the issue together with the complete, uncut console output.

The issue was introduced since 09ae7b81ea. It may slow down seeking in online streams.

You could still elaborate on how we can reproduce the issue you see.

comment:6 in reply to: ↑ 5 Changed 2 years ago by snorlaxzxz

Replying to cehoyos:

Replying to snorlaxzxz:

Replying to cehoyos:

Seeking works fine here for the uploaded sample.
Please provide the command line that allows to reproduce the issue together with the complete, uncut console output.

The issue was introduced since 09ae7b81ea. It may slow down seeking in online streams.

You could still elaborate on how we can reproduce the issue you see.

The first way:
You can reproduce the issue by accessing this file from a bandwidth limited web server (like 200KB/s)
It takes tens of seconds to seek to a far position.

Another way:
Set a break point or add an av_log() in parse_keyframes_index() in libavformat/flvdec.c .
It will not be called in n3.1.1 but works fine in n3.0

The reason is explained above.

comment:7 Changed 2 years ago by snorlaxzxz

  • Resolution set to fixed
  • Status changed from new to closed

Fixed #ad14aab

Note: See TracTickets for help on using tickets.