I am working on integrating a new video encoder. One issue I am having
is determining the frame rate of the input video stream. The is
available in the AVFormatContext but not in the AVCodecContext. The
AVCodecContext does contain a time_base value but this does not seem to
translate properly into a frame rate in all cases. There are some
video streams where the time_base is 50 / 2997 which would come to
59.94 fps. However, the AVFormatContext indicates the frame rate is
29.92 fps. I believe the actual frame rate is more likely the 29.92
value, however, this is not available at the libavcodec scope. Is
there any undocumented process for determining the actual frame rate at
the libavcodec scope?? I also tried using the pts value in the AVFrame
structure from the decoded frame. This turned out not to be provided
by the decoder and is always 0.
One example . . .
<<
Duration: 00:02:42.36, start: 0.000000, bitrate: 820 kb/s
Stream #0.0: Video: h264, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 820
kb/s, 58.82 fps, 29.92 tbr, 1k tbn, 59.94 tbc
Stream #0.1: Audio: aac, 22050 Hz, stereo, s16
Output #0, flv, to '':
Stream #0.0: Video: libx264, yuv420p, 640x352, q=2-31, 650 kb/s,
58.82 fps, 29.92 tbr, 1k tbn, 59.94 tbc
Stream #0.1: Audio: aac, 22050 Hz, stereo, s16
Here's a an even worse case . . .
<<
Duration: 00:04:45.05, start: 0.000000, bitrate: 195 kb/s
Stream #0.0, 21, 1/1000: Video: h264, yuv420p, 320x214 [PAR 1:1 DAR
160:107], 1/2000, 195 kb/s, 29.92 tbr, 1k tbn, 2k tbc
Stream #0.1, 15, 1/1000: Audio: aac, 22050 Hz, stereo, s16
Output #0, flv, to '':
Stream #0.0, 0, 1/1000: Video: libx264, yuv420p, 320x214, 1/2000,
q=2-31, 650 kb/s, 29.92 tbr, 1k tbn, 2k tbc
Stream #0.1, 0, 1/90000: Audio: aac, 22050 Hz, stereo, s16
Thanks,
Bob
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user