distorted video encoded with x264

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

distorted video encoded with x264

rafael.lmsousa
Hi all,

I'm using the versions of gstreamer installed from ubuntu 10.10 apt-get. I've installed the gstreamer, gst-plugins-bad, gst-plugins-good, gst-plugins-ugly, gst-ffmpeg and I've installed the x264.

The problem is that my pipeline gives as result a blurring video. My pipeline works to read a YUV file at the sender, encodes it in H.264, and sends it to receiver using RTP in encoding time. At the receiver, it receives the stream and stores it in YUV format again for posterior process. The pipeline is as follows:

Sender:

"gstrtpbin name=rtpbin filesrc location=paris_cif.yuv blocksize=152064 ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)15/1, format=(fourcc)I420 ! x264enc, key-int-max=30, key-int-min=15, intra-refresh=true ! rtph264pay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=5003 port=5001 sync=false async=false udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 "

Receiver:

"gstrtpbin name=rtpbin udpsrc caps=\"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink location=example.yuv udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false"

I don't know why the video is blurring since I've tested it localhost, without loss rates. The command that I'm using to watch the result is:

mplayer example.yuv -demuxer rawvideo -rawvideo cif

I took a screenshot of the video, it is in annex. Please, anyone can help?

thanks in advance

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

Captura_de_tela.png (167K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

Timothy Braun
I'm no expert on this, but ran into similar issues when making a local file. It ultimately ended up being the parameters I was passing to the x264enc element. I would take a look at those with gst-inspect and see if you can tune the output. Most notably the pass and quantizer parameters. 

Tim

Sent from my iPhone

On Dec 15, 2010, at 3:02 PM, Rafael Sousa <[hidden email]> wrote:

Hi all,

I'm using the versions of gstreamer installed from ubuntu 10.10 apt-get. I've installed the gstreamer, gst-plugins-bad, gst-plugins-good, gst-plugins-ugly, gst-ffmpeg and I've installed the x264.

The problem is that my pipeline gives as result a blurring video. My pipeline works to read a YUV file at the sender, encodes it in H.264, and sends it to receiver using RTP in encoding time. At the receiver, it receives the stream and stores it in YUV format again for posterior process. The pipeline is as follows:

Sender:

"gstrtpbin name=rtpbin filesrc location=paris_cif.yuv blocksize=152064 ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)15/1, format=(fourcc)I420 ! x264enc, key-int-max=30, key-int-min=15, intra-refresh=true ! rtph264pay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=5003 port=5001 sync=false async=false udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 "

Receiver:

"gstrtpbin name=rtpbin udpsrc caps=\"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink location=example.yuv udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false"

I don't know why the video is blurring since I've tested it localhost, without loss rates. The command that I'm using to watch the result is:

mplayer example.yuv -demuxer rawvideo -rawvideo cif

I took a screenshot of the video, it is in annex. Please, anyone can help?

thanks in advance
<Captura_de_tela.png>
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

rafael.lmsousa
In reply to this post by rafael.lmsousa
When I use the x264 build 85 that issue doesn't occur, the video is perfect, only in superior build that I tested (98 and 110) that the problem occur. I don't have any idea of what can be happening, I've already removed and installed the packages several times, I even upgraded my ubuntu system from 10.04 to 10.10 but no change. Anyone have any idea? I've tried all that I know. I need to use the build 98 or superior.

thanks for the reply

Message: 1
Date: Wed, 15 Dec 2010 15:42:01 -0500
From: Timothy Braun <[hidden email]>
Subject: Re: [gst-devel] distorted video encoded with x264
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

I'm no expert on this, but ran into similar issues when making a local file. It ultimately ended up being the parameters I was passing to the x264enc element. I would take a look at those with gst-inspect and see if you can tune the output. Most notably the pass and quantizer parameters.

Tim

Sent from my iPhone

On Dec 15, 2010, at 3:02 PM, Rafael Sousa <[hidden email]> wrote:

> Hi all,
>
> I'm using the versions of gstreamer installed from ubuntu 10.10 apt-get. I've installed the gstreamer, gst-plugins-bad, gst-plugins-good, gst-plugins-ugly, gst-ffmpeg and I've installed the x264.
>
> The problem is that my pipeline gives as result a blurring video. My pipeline works to read a YUV file at the sender, encodes it in H.264, and sends it to receiver using RTP in encoding time. At the receiver, it receives the stream and stores it in YUV format again for posterior process. The pipeline is as follows:
>
> Sender:
>
> "gstrtpbin name=rtpbin filesrc location=paris_cif.yuv blocksize=152064 ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)15/1, format=(fourcc)I420 ! x264enc, key-int-max=30, key-int-min=15, intra-refresh=true ! rtph264pay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=5003 port=5001 sync=false async=false udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 "
>
> Receiver:
>
> "gstrtpbin name=rtpbin udpsrc caps=\"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink location=example.yuv udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false"
>
> I don't know why the video is blurring since I've tested it localhost, without loss rates. The command that I'm using to watch the result is:
>
> mplayer example.yuv -demuxer rawvideo -rawvideo cif
>
> I took a screenshot of the video, it is in annex. Please, anyone can help?
>
> thanks in advance
> <Captura_de_tela.png>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

Tim-Philipp Müller-2
On Thu, 2010-12-16 at 01:11 -0300, Rafael Sousa wrote:

> When I use the x264 build 85 that issue doesn't occur, the video is
> perfect, only in superior build that I tested (98 and 110) that the
> problem occur. I don't have any idea of what can be happening, I've
> already removed and installed the packages several times, I even
> upgraded my ubuntu system from 10.04 to 10.10 but no change. Anyone
> have any idea? I've tried all that I know. I need to use the build 98
> or superior.

Just as a note, the x264enc plugin code has some special handling here
and there depending on the x264 version compiled against. It assumes
that the x264 version used at runtime is actually the one it was
compiled against as well at the moment. This can lead to weird things
happening when you upgrade/downgrade libx264 to a different version than
the plugin was compiled against.

So when you upgrade/downgrade libx264, you definitely need to recompile
gst-plugins-ugly.

(There may still be a bug of course..)
 
 Cheers
  -Tim


> thanks for the reply
>
> Message: 1
>         Date: Wed, 15 Dec 2010 15:42:01 -0500
>         From: Timothy Braun <[hidden email]>
>         Subject: Re: [gst-devel] distorted video encoded with x264
>         To: Discussion of the development of GStreamer
>                <[hidden email]>
>         Message-ID: <[hidden email]>
>         Content-Type: text/plain; charset="us-ascii"
>        
>         I'm no expert on this, but ran into similar issues when making
>         a local file. It ultimately ended up being the parameters I
>         was passing to the x264enc element. I would take a look at
>         those with gst-inspect and see if you can tune the output.
>         Most notably the pass and quantizer parameters.
>        
>         Tim
>        
>         Sent from my iPhone
>        
>         On Dec 15, 2010, at 3:02 PM, Rafael Sousa
>         <[hidden email]> wrote:
>        
>         > Hi all,
>         >
>         > I'm using the versions of gstreamer installed from ubuntu
>         10.10 apt-get. I've installed the gstreamer, gst-plugins-bad,
>         gst-plugins-good, gst-plugins-ugly, gst-ffmpeg and I've
>         installed the x264.
>         >
>         > The problem is that my pipeline gives as result a blurring
>         video. My pipeline works to read a YUV file at the sender,
>         encodes it in H.264, and sends it to receiver using RTP in
>         encoding time. At the receiver, it receives the stream and
>         stores it in YUV format again for posterior process. The
>         pipeline is as follows:
>         >
>         > Sender:
>         >
>         > "gstrtpbin name=rtpbin filesrc location=paris_cif.yuv
>         blocksize=152064 ! video/x-raw-yuv, width=352, height=288,
>         framerate=(fraction)15/1, format=(fourcc)I420 ! x264enc,
>         key-int-max=30, key-int-min=15, intra-refresh=true !
>         rtph264pay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 !
>         udpsink host=127.0.0.1 port=5000 rtpbin.send_rtcp_src_0 !
>         udpsink host=5003 port=5001 sync=false async=false udpsrc
>         port=5005 ! rtpbin.recv_rtcp_sink_0 "
>         >
>         > Receiver:
>         >
>         > "gstrtpbin name=rtpbin udpsrc caps=
>         \"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink location=example.yuv udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false"
>         >
>         > I don't know why the video is blurring since I've tested it
>         localhost, without loss rates. The command that I'm using to
>         watch the result is:
>         >
>         > mplayer example.yuv -demuxer rawvideo -rawvideo cif
>         >
>         > I took a screenshot of the video, it is in annex. Please,
>         anyone can help?
>         >
>         > thanks in advance
>         > <Captura_de_tela.png>
>         >
>         ------------------------------------------------------------------------------
>         > Lotusphere 2011
>         > Register now for Lotusphere 2011 and learn how
>         > to connect the dots, take your collaborative environment
>         > to the next level, and enter the era of Social Business.
>         > http://p.sf.net/sfu/lotusphere-d2d
>         > _______________________________________________
>         > gstreamer-devel mailing list
>         > [hidden email]
>         > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>        
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

Tim-Philipp Müller-2
On Thu, 2010-12-16 at 09:23 +0000, Tim-Philipp Müller wrote:

> It assumes that the x264 version used at runtime is actually the one it
>  was compiled against as well at the moment.

Actually, ignore all this. Apparently the plugin will just fail to
link/load if the versions are different...

Cheers
 -Tim



------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

Robert Swain-2
In reply to this post by rafael.lmsousa
On 15 December 2010 21:02, Rafael Sousa <[hidden email]> wrote:
> I'm using the versions of gstreamer installed from ubuntu 10.10 apt-get.
> I've installed the gstreamer, gst-plugins-bad, gst-plugins-good,
> gst-plugins-ugly, gst-ffmpeg and I've installed the x264.
> The problem is that my pipeline gives as result a blurring video. My
> pipeline works to read a YUV file at the sender, encodes it in H.264, and
> sends it to receiver using RTP in encoding time. At the receiver, it
> receives the stream and stores it in YUV format again for posterior process.

Using a newer version of x264 without recompiling -ugly against that
newer version will not make use of that newer version of x264. In
fact, x264enc should fail to load unless you still have the x264
version against which it was linked.

> The pipeline is as follows:
> Sender:
> "gstrtpbin name=rtpbin filesrc location=paris_cif.yuv blocksize=152064
> ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)15/1,
> format=(fourcc)I420 ! x264enc, key-int-max=30, key-int-min=15,
> intra-refresh=true ! rtph264pay
> ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1
> port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=5003 port=5001 sync=false
> async=false udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 "

Why don't you set a rate control method? The default is 1-pass ABR
2Mbps which should be overkill for 352x288 15fps.

> Receiver:
> "gstrtpbin name=rtpbin udpsrc
> caps=\"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000
> ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink
> location=example.yuv udpsrc port=5001 !
> rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005
> sync=false async=false"
> I don't know why the video is blurring since I've tested it localhost,
> without loss rates. The command that I'm using to watch the result is:
> mplayer example.yuv -demuxer rawvideo -rawvideo cif
> I took a screenshot of the video, it is in annex. Please, anyone can help?

The screenshot looks like heavy over-quantisation and subsequent very
heavy in-loop deblocking. This normally means that, considering the
bit rate should be overkill for this resolution and frame rate,
x264enc is not configured correctly.

I strongly recommend you actually set a rate control method, even if
it means just choosing a bit rate appropriate for your content. Then I
would recommend making use of the presets and tunings. For your
purposes you probably want a faster preset (whatever your cpu can
handle though default of medium may be OK, if not, you could reduce
the preset until it consistently and reliably encodes in realtime on
your machine) and the zerolatency tuning.

If you're still having issues, you made need to build gst from git
against x264 from git to see if the issue persists with current
development code. If it does, please report back.

Regards,
Rob

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: distorted video encoded with x264

rafael.lmsousa
In reply to this post by rafael.lmsousa
Hi all,

I've fixed my problem by adding the following parameter to the x264enc:

"pass=qual quantizer=20 tune=zerolatency"

the video presented was perfect... thanks for the replies.



On Thu, Dec 16, 2010 at 12:11 AM, Rafael Sousa <[hidden email]> wrote:
When I use the x264 build 85 that issue doesn't occur, the video is perfect, only in superior build that I tested (98 and 110) that the problem occur. I don't have any idea of what can be happening, I've already removed and installed the packages several times, I even upgraded my ubuntu system from 10.04 to 10.10 but no change. Anyone have any idea? I've tried all that I know. I need to use the build 98 or superior.

thanks for the reply

Message: 1
Date: Wed, 15 Dec 2010 15:42:01 -0500
From: Timothy Braun <[hidden email]>
Subject: Re: [gst-devel] distorted video encoded with x264
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

I'm no expert on this, but ran into similar issues when making a local file. It ultimately ended up being the parameters I was passing to the x264enc element. I would take a look at those with gst-inspect and see if you can tune the output. Most notably the pass and quantizer parameters.

Tim

Sent from my iPhone


On Dec 15, 2010, at 3:02 PM, Rafael Sousa <[hidden email]> wrote:

> Hi all,
>
> I'm using the versions of gstreamer installed from ubuntu 10.10 apt-get. I've installed the gstreamer, gst-plugins-bad, gst-plugins-good, gst-plugins-ugly, gst-ffmpeg and I've installed the x264.
>
> The problem is that my pipeline gives as result a blurring video. My pipeline works to read a YUV file at the sender, encodes it in H.264, and sends it to receiver using RTP in encoding time. At the receiver, it receives the stream and stores it in YUV format again for posterior process. The pipeline is as follows:
>
> Sender:
>
> "gstrtpbin name=rtpbin filesrc location=paris_cif.yuv blocksize=152064 ! video/x-raw-yuv, width=352, height=288, framerate=(fraction)15/1, format=(fourcc)I420 ! x264enc, key-int-max=30, key-int-min=15, intra-refresh=true ! rtph264pay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=5003 port=5001 sync=false async=false udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 "
>
> Receiver:
>
> "gstrtpbin name=rtpbin udpsrc caps=\"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! ffdec_h264 ! filesink location=example.yuv udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false"
>
> I don't know why the video is blurring since I've tested it localhost, without loss rates. The command that I'm using to watch the result is:
>
> mplayer example.yuv -demuxer rawvideo -rawvideo cif
>
> I took a screenshot of the video, it is in annex. Please, anyone can help?
>
> thanks in advance
> <Captura_de_tela.png>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel