[Ffmpeg-devel] Strange problem with H.264 video in MPEG2 TS...

Luca Abeni lucabe72
Fri Jan 20 09:38:11 CET 2006


Hi all,

I am hitting some strange problem... How to reproduce:
./output_example source.avi
mkfifo fifo.ts
./ffmpeg -y -i source.avi -vcodec h264 fifo.ts
in a different window, ./ffmpeg -i fifo.ts
The output in the second window is:
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-gpl --enable-x264 --extra-cflags=-I /tmp/x264 --extra-ldflags=-L /tmp/x264 
  libavcodec version: 51.1.0
  libavformat version: 50.0.0
  built on Jan 20 2006 18:09:35, gcc: 4.0.3 20060115 (prerelease) (Debian 4.0.2-7)
[h264 @ 0x83af8c8]non existing PPS referenced
[h264 @ 0x83af8c8]decode_slice_header error
Input #0, mpegts, from 'fifo.ts':
  Duration: N/A, bitrate: 64 kb/s
  Stream #0.0[0x100], 12.50 fps(r): Video: h264, yuv420p, 352x288
  Stream #0.1[0x101]: Audio: mp2, 44100 Hz, stereo, 64 kb/s
Must supply at least one output file

The detected frame rate for the video (12.50) is obviously wrong.

If I use mpeg4 video instead of H.264, everything works well:
./output_example source.avi
mkfifo fifo.ts
./ffmpeg -y -i source.avi -vcodec mpeg4 fifo.ts
in a different window, ./ffmpeg -i fifo.ts
The output in the second window is:
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-gpl --enable-x264 --extra-cflags=-I /tmp/x264 --extra-ldflags=-L /tmp/x264 
  libavcodec version: 51.1.0
  libavformat version: 50.0.0
  built on Jan 20 2006 18:09:35, gcc: 4.0.3 20060115 (prerelease) (Debian 4.0.2-7)
Input #0, mpegts, from 'fifo.ts':
  Duration: N/A, bitrate: 64 kb/s
  Stream #0.0[0x100], 25.00 fps(r): Video: mpeg4, yuv420p, 352x288
  Stream #0.1[0x101]: Audio: mp2, 44100 Hz, stereo, 64 kb/s
Must supply at least one output file

As you can see, the detected frame rate is correct.


It is interesting to note that this problem only happens when ffmpeg is
reading the input from a pipe. If I do
./output_example source.avi
./ffmpeg -y -i source.avi -vcodec h264 file.ts
./ffmpeg -i file.ts
I get
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-gpl --enable-x264 --extra-cflags=-I /tmp/x264 --extra-ldflags=-L /tmp/x264 
  libavcodec version: 51.1.0
  libavformat version: 50.0.0
  built on Jan 20 2006 18:09:35, gcc: 4.0.3 20060115 (prerelease) (Debian 4.0.2-7)
Input #0, mpegts, from 'file.ts':
  Duration: 00:00:00.6, start: 0.000000, bitrate: 3404 kb/s
  Stream #0.0[0x100], 25.00 fps(r): Video: h264, yuv420p, 352x288
  Stream #0.1[0x101]: Audio: mp2, 44100 Hz, stereo, 64 kb/s
Must supply at least one output file

which is correct...

So, summing up, it seems that the problem is limited to H.264 video in
MPEG2TS when the input is read from a pipe...
Any ideas?
How is the fps computed? By decoding the first frames of the H.264
stream? If yes, does the H.264 decoder need to do some seek? (this is
the only case in which I can immagine something different when reading
from a pipe...)


			Thanks,
				Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Telefonare all'estero risparmiando fino all'80%? Con Email.it Phone Card puoi, clicca e scopri tutti i vantaggi
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2683&d=20-1





More information about the ffmpeg-devel mailing list