On Wed, 3 Jun 2009, Richard Archer wrote:
> I'm running mjpegtools on a Centos 5 x86_64 (Intel) system and
> y4mstabilizer is crashing.
mjpegtools build either from the last release (end of Dec 2009) or from
CVS (which
hasn't changed too much)?
> My source file is a snippet of interlaced video from a DVD.
> I pre-process it with ffmpeg and pipe it into y4mstabilizer.
Oh - and I think that is the problem.
> I have also tried using yuvdeinterlace prior to y4mstabilizer
> but then it crashes on frame 2.
I think it's the output from ffmpeg that's the problem.
> I have tried scaling the stream to 768x576 (SAR 1:1) but that
> didn't help either.
Not necessary.
> Here's the setup and the results:
>
> $ ffmpeg -deinterlace -i "test.m2v" -r 25.000 -s 720x576
> -aspect 4:3 -f yuv4mpegpipe -aspect 4:3 -pix_fmt yuv444p - |
> y4mstabilizer -v -v >/dev/null
ffmpeg doesn't know the rate or frame size? I would have thought that
none of those
options would be necessary if the input stream is properly formed.
The PROBLEM the use of "-pix_fmt yuv444p". -pix_fmt does not scale or
resample the
data!! -pix_fmt simply tells ffmpeg what value to put into the
yuv4mpeg header.
So the next application is getting 4:2:0 data but is TOLD that the data
is 4:4:4
and that I think is causing the problem.
MPEG-2 is 4:2:0. The correct -pix_fmt ot use is 420p.
You need to use y4mscaler to do the chroma upsampling.
Maybe ffmpeg can do the chroma resampling but I'm fairly sure that
-pix_fmt is not
the way to do it.
> Seems stream 0 codec frame rate differs from container frame rate: 50.00
> (50/1) -> 25.00 (25/1)
ffmpeg is saying your input is 50 frames/sec? Hmmm, interesting.
> Input #0, mpegvideo, from 'test.m2v':
> Duration: 00:00:46.50, bitrate: 3938 kb/s
> Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 4:3],
> 3938 kb/s, 25 tbr, 1200k tbn, 50 tbc
> Output #0, yuv4mpegpipe, to 'pipe:':
> Stream #0.0: Video: rawvideo, yuv444p, 720x576 [PAR 16:15 DAR 4:3],
> q=2-31, 200 kb/s, 90k tbn, 25 tbc
UGH! What is a PAR (Pixel Aspect Ratio) of 16:15? PAL is something
like 59:54 as
I recall. But then I always ignored the y4m header that ffmpeg output
and
put on my own ;)
Maybe it's just as well the programs crashed :) Looks like the video
is being
mangled.
> Press [q] to stop encoding
> INFO: [y4mstabilizer] frame size: 720x576 pixels (1244160 bytes)
> INFO: [y4mstabilizer] chroma: 4:4:4 (no subsampling)
> INFO: [y4mstabilizer] frame rate: 25/1 fps (~25.000000)
> INFO: [y4mstabilizer] interlace: top-field-first
> INFO: [y4mstabilizer] sample aspect ratio: 16:15
The 'frame size' is calculated by multiplying the width, height, and
chroma sampling.
That value is correct for 4:4:4 but the data is still just 4:2:0
> And there ends my ability to debug this problem :(
I can't recall if there were issues with y4mstabilizer on the 64 bit
platforms or
not. I never used the program much and the author has abandoned the
program
(you can try email to [email protected] (Jim) but I suspect he hasn't
been actively
involved with the program for some time).
> I'm happy to follow instructions to help isolate the bug and
> to apply patches and rebuild to test a solution.
I would try getting correct data into the program before any more
debugging ;)
with ffmpeg something like this might stand a better chance:
ffmpeg -i test.m2v -pix_fmt yuv420p | \
yyuvdeinterlace | \
y4mscaler -v 0 -O sar=src -O chromass=444 | \
y4mstablizer | \
y4mscaler -v 0 -O sar=src -O chromass=420_MPEG2 | ...
the last y4mscaler goes back to 4:2:0 for encoding, etc.
My preference for decoding is to use 'mpeg2dec' but I think if you let
ffmpeg emit
4:2:0 things will work OK.
Good Luck!
Cheers,
Steven Schultz
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Mjpeg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users