mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 11:40:38 +00:00
be40a1d479
This patch adds a simple-encoder test program that uses libgstvaapi for video encoding to elementary (raw) streams. Input stream is raw YUV in the Y4M format. That can be from a regular file or standard input when the input filename is "-". Usage: simple-encoder [options]* <source> Options: --output|-o output file name --codec|-c codec to use for video encoding --bitrate|-b desired bitrate (kbps) By default, and as an initial patch, the encoded stream shall conform to the minimally supported profile. That is "Constrained Baseline Profile" for H.264 and "Simple Profile" for MPEG-2. Though, those are the defaults to be generated by libgstvaapi. You can find Y4M sample files here http://samples.mplayerhq.hu/yuv4mpeg2/ Original-patch-by: Changzhi Wei <changzhix.wei@intel.com> * general code clean-up * removed the yuv reader thread * re-wrote the y4m file parser * updated used API fixed some wrong usage * fixed a lot of memory leaks * added the bitrate setting * keep fps' numerator and denominator * simplified the thread control * removed custom logging and use glib Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=719528
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
/*
|
|
* y4mreader.h - Y4M parser
|
|
*
|
|
* Copyright (C) 2015 Intel Corporation
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
* as published by the Free Software Foundation; either version 2.1
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "gst/vaapi/sysdeps.h"
|
|
#include <gst/vaapi/gstvaapiimage.h>
|
|
|
|
typedef struct _Y4MReader Y4MReader;
|
|
|
|
struct _Y4MReader
|
|
{
|
|
FILE *fp;
|
|
guint width;
|
|
guint height;
|
|
gint fps_n;
|
|
gint fps_d;
|
|
};
|
|
|
|
Y4MReader *y4m_reader_open (const gchar * filename);
|
|
|
|
void y4m_reader_close (Y4MReader * file);
|
|
|
|
gboolean y4m_reader_load_image (Y4MReader * file, GstVaapiImage * image);
|