Hi,

I am new in FFMpeg, the following is my experiment on a
mpeg2 video:

Input #0, mpeg, from 'LGW_20071101_E1_CAM4.mpeg':
  Duration: 02:04:55.5, start: 0.500000, bitrate: 2535 kb/s
  Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 9000 kb/s,
25.00 fps(r)

resolution: 720 x 576
frame rate: 25 / 1
time base: 1 / 90000
stream index: 0
start time: 45000
total duration: 674600400

The first question is that the document says av_read_frame
will return a packet exactly contains one frame. So if
got_picture_ptr == 0 after avcodec_decode_video called,
it means ``this frame cannot be decompressed but it's still a
frame'' not ``this packet is not complete, read the next
one'', right? (this question is related to the frame number
counting, should I count it even if decoding fail, or should I
skip it?)

The second question is about dts and pts.
The following is the information from av_read_frame called
one by one:

no: 0, dts: 41400, pts: 45000 (got_picture_ptr == 0)
no: 1, dts: 45000, pts: 55800
no: 2, dts: 48600, pts: 48600
no: 3, dts: 52200, pts: 52200
no: 4, dts: 55800, pts: 66600
no: 5, dts: 59400, pts: 59400
no: 6, dts: 63000, pts: 63000
no: 7, dts: 66600, pts: 77400
no: 8, dts: 70200, pts: 70200
no: 9, dts: 73800, pts: 73800
...

I have written the frame to images to check the order of
the frames, the order is correct in my case. So the question
is why the pts is not in order? Another question is that the
first frame (no. 0) is fail to decode in most of my test video,
is it normal or no. 0 not a frame? Does the start_time (45000)
refer to frame no. 0(pts == 45000) or  frame no. 1(dts == 45000)?

Another question is about the av_seek_frame. Follow the
previous example, if I call av_seek_frame( ..., 55800, ...),
does the seeking depends on dts or pts? (Will the pointer
go to the frame no. 4 with dts == 55800, or go to the frame
no. 1 with pts == 55800?)

The last question, is there any description in detail about
the flags AVSEEK_FLAG_{BACKWARD, BYTE, ANY} used
for av_seek_frame? In my experiments the av_seek_frame
doesn't respect to the flags in some video, is there any
limitation about the flags?

Sorry for quite a lot of questions, thank you very much for
the answering.

Regards,
Tz-Huan
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to