Hello,

I have two issues which are somehow connected so I will post them together.
The common problem for them is that I am unable to successfully run
av_seek_frame() on them when using time stamp. With byte seek it works fine.

Issue1:

I am using ffmpeg library in my application. So far it was going fine, but
with some test files I fail to make a successful seek.

I am using function av_seek_frame() and for most of the files it works
perfectly fine, but for some of them it just returns an error. It happens
even if I try to seek to a 0 timestamp position. The function works
perfectly fine with byte seek for this files, but for time seek it just
fails.

Unfortunately I cannot upload the files but maybe someone could provide me
with some help. I can provide you with some logs from the console tool for
the files.

File 1:
Log1:
*$ ffmpeg -i test1.tts
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpegts @ 0x8210420]max_analyze_duration reached
Input #0, mpegts, from 'test1.tts':
  Duration: 00:01:09.37, start: 2982.616178, bitrate: 4543 kb/s
  Program 103
    Stream #0.0[0x1011]: Video: mpeg2video, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1021]: Audio: aac, 48000 Hz, stereo, s16, 237 kb/s
At least one output file must be specified*

Log 2(I am not much familiar with the console app so here is a log where I
figured out how to use the -ss functionality)
*$ ffmpeg -ss 1 -i test1.tts -r 1 -s 30x30 -f image2 foo-%03d.jpeg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpegts @ 0x80d0420]max_analyze_duration reached
test1.tts: could not seek to position 2983.616
Input #0, mpegts, from 'test1.tts':
  Duration: 00:01:09.37, start: 2982.616178, bitrate: 4543 kb/s
  Program 103
    Stream #0.0[0x1011]: Video: mpeg2video, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1021]: Audio: aac, 48000 Hz, stereo, s16, 237 kb/s
Output #0, image2, to 'foo-%03d.jpeg':
  Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Video: mjpeg, yuvj420p, 30x30 [PAR 16:9 DAR 16:9], q=2-31,
200 kb/s, 90k tbn, 1 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=    0 fps=  0 q=0.0 Lsize=      -0kB time=10000000000.00 bitrate=
-0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%*


So this is how it ends up. When i try to do av_seek_frame(format_ctx, -1,
0,AVSEEK_FLAG_ANY) in my code for this file I can see that ffmpeg reaches
EOF and the position in format_ctx->pb is set 4 bytes higher the the actual
file_size and the function simply returns an error.

Below there are logs for second file which gives the same results when
trying to seek.

File 2:
Log 1:
*$ ffmpeg -i test2-TTS-Aligned.tts
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpegts @ 0x8fec420]max_analyze_duration reached
Input #0, mpegts, from 'test2-TTS-Aligned.tts':
  Duration: 00:01:09.37, start: 2982.616178, bitrate: 4543 kb/s
  Program 103
    Stream #0.0[0x1011]: Video: mpeg2video, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1021]: Audio: aac, 48000 Hz, stereo, s16, 237 kb/s
At least one output file must be specified

*Log 2:
*$ ffmpeg -ss 1 -i test2-TTS-Aligned.tts -r 1 -s 30x30 -f image2
foo-%03d.jpeg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpegts @ 0x9cf0420]max_analyze_duration reached
test2-TTS-Aligned.tts: could not seek to position 2983.616
Input #0, mpegts, from 'test2-TTS-Aligned.tts':
  Duration: 00:01:09.37, start: 2982.616178, bitrate: 4543 kb/s
  Program 103
    Stream #0.0[0x1011]: Video: mpeg2video, yuv420p, 1440x1080 [PAR 4:3 DAR
16:9], 8000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1021]: Audio: aac, 48000 Hz, stereo, s16, 237 kb/s
Output #0, image2, to 'foo-%03d.jpeg':
  Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Video: mjpeg, yuvj420p, 30x30 [PAR 16:9 DAR 16:9], q=2-31,
200 kb/s, 90k tbn, 1 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=    0 fps=  0 q=0.0 Lsize=      -0kB time=10000000000.00 bitrate=
-0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%


*Issue2:

With some other file I also fail with time seek for it, but there is one
more problem. The duration is just wrong. With just "ffmpeg -i name" command
the duration is just some random value (even negative). The logs are below
(two runs, one of them negative):

*$ ffmpeg -i test1_SCRSkipBackward.mpg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpeg @ 0x91a6420]max_analyze_duration reached
Input #0, mpeg, from 'test1_SCRSkipBackward.mpg':
  Duration: 533504:56:00.44, start: 55.674533, bitrate: N/A
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR
4:3], 9800 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s
    Stream #0.2[0x1c0]: Audio: mp2, 0 channels
At least one output file must be specified

$ ffmpeg -i test1_SCRSkipBackward.mpg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[mpeg @ 0x920d420]max_analyze_duration reached
Input #0, mpeg, from 'test1_SCRSkipBackward.mpg':
  Duration: -526344:-31:-38.11, start: 55.674533, bitrate: N/A
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR
4:3], 9800 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s
    Stream #0.2[0x1c0]: Audio: mp2, 0 channels
At least one output file must be specified*


When I run a command with analyzeduration param the value is not random
anymore, it is always the same, but it is completely wrong:

*$ ffmpeg -analyzeduration 25M -i test1_SCRSkipBackward.mpg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct 18 2010 15:41:25 with gcc 4.4.3
  configuration: --disable-static --enable-shared
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
Input #0, mpeg, from 'test1_SCRSkipBackward.mpg':
  Duration: 26:29:59.98, start: 55.674533, bitrate: 1 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR
4:3], 9800 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s
    Stream #0.2[0x1c0]: Audio: mp2, 0 channels
At least one output file must be specified*

The duration is over 26 hours but the file lasts less than a minute.
There is one more hint for the last file. For this file I was also provided
with an .ifo file named the same as .mpg file.



Thanks in advance for any help.

Przemek Pabianczyk
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to