Read from YUV file

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

Read from YUV file

gstreader
How we can read from YUV file using C code and encode that file using x264enc and finally save that encoded output in .264 file?

Please do let me know.
Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

Tim Müller
On Tue, 2016-02-16 at 01:23 -0800, gstreader wrote:

> How we can read from YUV file using C code and encode that file using
> x264enc and finally save that encoded output in .264 file?

It depends what format your YUV file is in.

If it's y4m use

  filesrc location=video.y4m ! y4mdec ! ...

If it's just raw YUV data use

  filesrc location=video.yuv ! videoparse format=i420 width=..
height=.. ! ...

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

Sebastian Dröge-3
In reply to this post by gstreader
On Di, 2016-02-16 at 01:23 -0800, gstreader wrote:
> How we can read from YUV file using C code and encode that file using
> x264enc and finally save that encoded output in .264 file?

Take a look at the videoparse element and its properties :)

> View this message in context: http://gstreamer-devel.966125.n4.nabble
> .com/Read-from-YUV-file-tp4675875.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.

Please don't use Nabble for posting on this mailing list, it tends to
drop text from mails and otherwise corrupt the text.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

gstreader
In reply to this post by Tim Müller
Thanks for the reply.

I have tried this pipeline:
gst-launch-0.10 -v filesrc location=akiyo_cif.yuv ! videoparse format=i420 width=352 height=288 framerate=15/1 ! x264enc ! filesink location=encstr.h264

but it is not working properly.
I am getting the error when I parse that encstr.h264 file using ldecod.
Error:Error while getting the NALU in file format Annex B exit

What am doing wrong here!!!
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

Tim Müller
On Tue, 2016-02-16 at 23:38 -0800, gstreader wrote:

Hi,

You're using an ancient version of GStreamer that is no longer
maintained, you should really try and upgrade to 1.x if possible at
all.

> I have tried this pipeline:
> gst-launch-0.10 -v filesrc location=akiyo_cif.yuv ! videoparse
> format=i420
> width=352 height=288 framerate=15/1 ! x264enc ! filesink
> location=encstr.h264
>
> but it is not working properly.
> I am getting the error when I parse that encstr.h264 file using
> ldecod.
> Error:Error while getting the NALU in file format Annex B exit
>
> What am doing wrong here!!!

I think in older versions x264enc would output H.264 in AVC stream-
format by default. You can force it to bytestream like this:


 ... ! x264enc ! video/x-h264,stream-format=byte-stream ! fakesink

Cheers
 -Tim


-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

gstreader
Thank you very much. It works after set byte-stream=TRUE for x264enc.
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

GStreamer-devel mailing list
In reply to this post by Tim Müller
Hello, i had written a c program to implement appsink in the pipeline.But i
am getting errors as could not demultiplex stream. Any suggestions?




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Read from YUV file

GStreamer-devel mailing list
In reply to this post by gstreader


Le mar. 16 févr. 2016 04 h 23, gstreader <[hidden email]> a écrit :
How we can read from YUV file using C code and encode that file using x264enc
and finally save that encoded output in .264 file?

You can read raw yuv from file using rawvideoparse element, don't forget to configure it properly.



Please do let me know.
Thanks in advance.




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Read-from-YUV-file-tp4675875.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel