Page 1 of 1

transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:29
by mangoo
I'm trying to transcode mpeg video delivered by a Vivotek IP7137 camera to WMV1 or WMV2.

When I transcode the stream using 0.8.6c, the quality is good.

When I transcode the stream using the same options and 0.9.0 (svn), the quality is very poor - biiig pixels.

This only seem to affect MPEG and 0.9.0 (svn); MJPEG transcoded to WMV2 by 0.9.0 (svn) is of good quality.

Any ideas what it might be? Forgot to compile something in?

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:31
by Jean-Baptiste Kempf
libmpeg2 not compiled ?

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:31
by dionoea
you can run vlc --list on both versions and compare the output to know if something's missing in 0.9.0.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:41
by mangoo
you can run vlc --list on both versions and compare the output to know if something's missing in 0.9.0.
I did vlc --list | grep -i mpe | sort for both players, and then, diffed the output:

$ diff -u 0.8 0.9
--- 0.8 2007-07-25 11:33:29.075704057 +0200
+++ 0.9 2007-07-25 11:33:32.575170231 +0200
@@ -1,4 +1,4 @@
- ffmpeg FFmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)
+ ffmpeg FFmpeg audio/video decoders/encoders
ffmpeg FFmpeg audio/video encoder
ffmpeg FFmpeg chroma conversion
ffmpeg FFmpeg crop padd filter
@@ -20,6 +20,5 @@
packetizer_mpegvideo MPEG-I/II video packetizer
ps MPEG-PS demuxer
ps MPEG-PS demuxer
- stream_out_switcher MPEG2 video switcher stream output
ts MPEG Transport Stream demuxer
-VLC media player 0.8.6c Janus
+VLC media player 0.9.0-svn Grishenko


So basically, the only thing that differs is stream_out_switcher not present in 0.9.0.

Can it make a difference? I'll build 0.9.0 with --enable-switcher to see if anything's changed.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:45
by dionoea
It won't make any difference (switcher is some fancy stream output plugin which only one person knows how to use ... and what it's used for). The problem might be with the ffmpeg version you compiled. Or maybe with the configure flags you used in ffmpeg (if you didn't already try, try compiling ffmpeg with --disable-swscaler).

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:54
by mangoo
It won't make any difference (switcher is some fancy stream output plugin which only one person knows how to use ... and what it's used for). The problem might be with the ffmpeg version you compiled. Or maybe with the configure flags you used in ffmpeg (if you didn't already try, try compiling ffmpeg with --disable-swscaler).
As I remember, I didn't use any flags to ffmpeg.

Any other recommendations besides --disable-swscaler?

I just need transcoding from mpeg-4 to WMV2, no audio.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 11:55
by dionoea
You'll at least need --enable-pp --enable-gpl to get ffmpeg to link with VLC.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 13:15
by mangoo
You'll at least need --enable-pp --enable-gpl to get ffmpeg to link with VLC.
It linked for me without --enable-pp --enable-gpl flags.

So, I compiled ffmpeg:

./configure --disable-swscaler --enable-pp --enable-gpl

And VLC:

./configure --with-ffmpeg-tree=/home/build/vlc/ffmpeg --enable-live555 --with-live555-tree=/usr/lib/live


And still, the transcoded image from a MPEG camera is very pixelized :(
On the other hand, transcoded image from a MJPEG camera looks very good.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 13:25
by mangoo
This is the line I use to start VLC:

vlc --sout-keep -I dummy --run-time 60 -L playlist.xspf --sout "#transcode{vcodec=WMV2,vb=512,scale=1}:gather:std{access=mmsh,dst=:1755,mux=ts}"

Increasing bitrate (vb) doesn't change anything at all.

And these are the sources (MPEG and MJPEG) on the playlist - both give good quality when opened without transcoding:

rtsp://192.168.111.188/live.sdp

http://192.168.111.189/nphMotionJpeg?Re ... y=Standard


What's interesting, the *first* second from the MPEG camera gives good quality; only later the image gets very pixelized (when transcoding, that is; without transcoding, quality is always OK).

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 13:36
by dionoea
Hum, I really don't know what that's due to. (btw, why are you using wmv2?)

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 14:21
by mangoo
Hum, I really don't know what that's due to. (btw, why are you using wmv2?)
The stream from cameras will be placed on a website.

AFAIK, WMV1 or WMV2 are the only codecs which work with Windows Media Player (that is, not requiring the user to install any 3rd party codecs or tools). Of course, I'd like to be wrong here.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 14:39
by dionoea
DIV3 also works (and it's better than wmv1/2 in my opinion).

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 15:23
by mangoo
DIV3 also works (and it's better than wmv1/2 in my opinion).
Indeed, DIV3 seems to work, thanks for the tip.

I made some tests, and the issue is not 0.9.0 or WMV2 specific.

With 0.8.6c on Windows, I can see exactly the same behaviour.

To reproduce:

- open any MPEG4 stream or movie
- Stream/Save -> Settings -> Transcoding options -> choose mp4v, WMV2
- test with different bitrates

With network streams, even though the delivered stream is 256 kb/s, when transcoded by VLC, the video gets very pixelized.
Interesting things:

1. First second is not pixelized
2. For WMV2 and mp4v pixelization doesn't disappear even when we set bitrate to 3072


With movies, it's similar, although it's harder to spot (usually, movies have bigger resolution than 320x240).

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 15:42
by mangoo
All right, this is what I found out:

This camera streams using UDP, and has a link: rtsp://192.168.111.188/live.sdp

When I open this stream directly in VLC, and transcode it there, the video is very pixelized.

However, when I use another VLC as a "proxy" (no transcoding), picture is OK:

rtsp://192.168.111.188/live.sdp -> VLC output HTTP (no transcoding) -> VLC transcoding


This doesn't make much sense, does it?

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 16:42
by dionoea
Yup, doesn't make much sense to me.

Re: transcoding MPEG: 0.8.6c - good; 0.9.0(svn) - poor quality

Posted: 25 Jul 2007 16:44
by mangoo
Yup, doesn't make much sense to me.
Looks like some kind of a bug to me, though ;)