2022-12-20 09:18:10

by Ming Qian

[permalink] [raw]
Subject: [PATCH 1/2] media: add RealMedia format

RealMedia is a proprietary multimedia container format
created by RealNetworks with the filename extension .rm.
RealMedia is generally used in conjunction with RealVideo and RealAudio,
while also being used for streaming content over the Internet.

Signed-off-by: Ming Qian <[email protected]>
---
.../userspace-api/media/v4l/pixfmt-compressed.rst | 11 +++++++++++
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
3 files changed, 13 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
index 8794b92fde36..31ba2c00091e 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
@@ -237,6 +237,17 @@ Compressed Formats
Metadata associated with the frame to decode is required to be passed
through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
+ * .. _V4L2-PIX-FMT-RV:
+
+ - ``V4L2_PIX_FMT_RV``
+ - 'RealMedia'
+ - RealMedia is a proprietary multimedia container format
+ created by RealNetworks with the filename extension .rm.
+ RealMedia is generally used in conjunction with RealVideo and RealAudio,
+ while also being used for streaming content over the Internet.
+ Typically these streams are in CBR (constant bitrate),
+ but a container for VBR (variable bitrate) streams
+ named RMVB (RealMedia variable bitrate) has been developed.

.. raw:: latex

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 9b5b04b8aa69..a4d12eea7fc5 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1473,6 +1473,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in vicodec */
case V4L2_PIX_FMT_FWHT_STATELESS: descr = "FWHT Stateless"; break; /* used in vicodec */
case V4L2_PIX_FMT_SPK: descr = "Sorenson Spark"; break;
+ case V4L2_PIX_FMT_RV: descr = "RealMedia"; break;
case V4L2_PIX_FMT_CPIA1: descr = "GSPCA CPiA YUV"; break;
case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break;
case V4L2_PIX_FMT_SN9C10X: descr = "GSPCA SN9C10X"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 262ef10cfa02..a7a7969ae4f8 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -740,6 +740,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
#define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
#define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
+#define V4L2_PIX_FMT_RV v4l2_fourcc('R', 'V', '0', '0') /* RealMedia */

/* Vendor-specific formats */
#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
--
2.38.1


2023-01-11 14:44:00

by Nicolas Dufresne

[permalink] [raw]
Subject: Re: [PATCH 1/2] media: add RealMedia format

Hi Ming,

sorry for the late reply ...

Le mardi 20 décembre 2022 à 16:39 +0800, Ming Qian a écrit :
> RealMedia is a proprietary multimedia container format
> created by RealNetworks with the filename extension .rm.
> RealMedia is generally used in conjunction with RealVideo and RealAudio,
> while also being used for streaming content over the Internet.
>
> Signed-off-by: Ming Qian <[email protected]>
> ---
> .../userspace-api/media/v4l/pixfmt-compressed.rst | 11 +++++++++++
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> include/uapi/linux/videodev2.h | 1 +
> 3 files changed, 13 insertions(+)
>
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> index 8794b92fde36..31ba2c00091e 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
> @@ -237,6 +237,17 @@ Compressed Formats
> Metadata associated with the frame to decode is required to be passed
> through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
> See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
> + * .. _V4L2-PIX-FMT-RV:
> +
> + - ``V4L2_PIX_FMT_RV``
> + - 'RealMedia'
> + - RealMedia is a proprietary multimedia container format
> + created by RealNetworks with the filename extension .rm.
> + RealMedia is generally used in conjunction with RealVideo and RealAudio,
> + while also being used for streaming content over the Internet.
> + Typically these streams are in CBR (constant bitrate),
> + but a container for VBR (variable bitrate) streams
> + named RMVB (RealMedia variable bitrate) has been developed.

I'm a bit confused with the description here. It describes the RealMedia (RM)
container format, but what you wanted is a RealVideo encoding (RV).

A quick search into FFMpeg (the only Open Source software decoder I could find),
the RealVideo comes in 4 incompatible flavours, RV10/RV20/RV30/RV40 also known
as RealVideo 1 / G2 / 8 / 9+10. I think the format here should be a RealVideo
format, and it should specify the flavours you want to support (probably only
RV40).

regards,
Nicolas

>
> .. raw:: latex
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 9b5b04b8aa69..a4d12eea7fc5 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1473,6 +1473,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in vicodec */
> case V4L2_PIX_FMT_FWHT_STATELESS: descr = "FWHT Stateless"; break; /* used in vicodec */
> case V4L2_PIX_FMT_SPK: descr = "Sorenson Spark"; break;
> + case V4L2_PIX_FMT_RV: descr = "RealMedia"; break;
> case V4L2_PIX_FMT_CPIA1: descr = "GSPCA CPiA YUV"; break;
> case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break;
> case V4L2_PIX_FMT_SN9C10X: descr = "GSPCA SN9C10X"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 262ef10cfa02..a7a7969ae4f8 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -740,6 +740,7 @@ struct v4l2_pix_format {
> #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
> #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
> #define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
> +#define V4L2_PIX_FMT_RV v4l2_fourcc('R', 'V', '0', '0') /* RealMedia */
>
> /* Vendor-specific formats */
> #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */

2023-01-12 01:34:49

by Ming Qian

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH 1/2] media: add RealMedia format

>From: Nicolas Dufresne <[email protected]>
>Sent: 2023年1月11日 22:28
>To: Ming Qian <[email protected]>; [email protected]; hverkuil-
>[email protected]
>Cc: [email protected]; [email protected]; [email protected];
>[email protected]; [email protected]; dl-linux-imx <linux-
>[email protected]>; X.H. Bao <[email protected]>; Ming Zhou
><[email protected]>; [email protected]; linux-
>[email protected]; [email protected]
>Subject: [EXT] Re: [PATCH 1/2] media: add RealMedia format
>
>Caution: EXT Email
>
>Hi Ming,
>
>sorry for the late reply ...
>
>Le mardi 20 décembre 2022 à 16:39 +0800, Ming Qian a écrit :
>> RealMedia is a proprietary multimedia container format created by
>> RealNetworks with the filename extension .rm.
>> RealMedia is generally used in conjunction with RealVideo and
>> RealAudio, while also being used for streaming content over the Internet.
>>
>> Signed-off-by: Ming Qian <[email protected]>
>> ---
>> .../userspace-api/media/v4l/pixfmt-compressed.rst | 11 +++++++++++
>> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
>> include/uapi/linux/videodev2.h | 1 +
>> 3 files changed, 13 insertions(+)
>>
>> diff --git
>> a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
>> b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
>> index 8794b92fde36..31ba2c00091e 100644
>> --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
>> +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst
>> @@ -237,6 +237,17 @@ Compressed Formats
>> Metadata associated with the frame to decode is required to be passed
>> through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
>> See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
>> + * .. _V4L2-PIX-FMT-RV:
>> +
>> + - ``V4L2_PIX_FMT_RV``
>> + - 'RealMedia'
>> + - RealMedia is a proprietary multimedia container format
>> + created by RealNetworks with the filename extension .rm.
>> + RealMedia is generally used in conjunction with RealVideo and
>RealAudio,
>> + while also being used for streaming content over the Internet.
>> + Typically these streams are in CBR (constant bitrate),
>> + but a container for VBR (variable bitrate) streams
>> + named RMVB (RealMedia variable bitrate) has been developed.
>
>I'm a bit confused with the description here. It describes the RealMedia (RM)
>container format, but what you wanted is a RealVideo encoding (RV).
>
>A quick search into FFMpeg (the only Open Source software decoder I could
>find), the RealVideo comes in 4 incompatible flavours, RV10/RV20/RV30/RV40
>also known as RealVideo 1 / G2 / 8 / 9+10. I think the format here should be a
>RealVideo format, and it should specify the flavours you want to support
>(probably only RV40).
>
>regards,
>Nicolas

Hi Nicolas,
Yes, you're right, I confused the encoding format with the container format,
I'll check and correct it.
Thanks very much

Ming

>
>>
>> .. raw:: latex
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
>> b/drivers/media/v4l2-core/v4l2-ioctl.c
>> index 9b5b04b8aa69..a4d12eea7fc5 100644
>> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
>> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
>> @@ -1473,6 +1473,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc
>*fmt)
>> case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in
>vicodec */
>> case V4L2_PIX_FMT_FWHT_STATELESS: descr = "FWHT Stateless";
>break; /* used in vicodec */
>> case V4L2_PIX_FMT_SPK: descr = "Sorenson Spark"; break;
>> + case V4L2_PIX_FMT_RV: descr = "RealMedia"; break;
>> case V4L2_PIX_FMT_CPIA1: descr = "GSPCA CPiA YUV"; break;
>> case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break;
>> case V4L2_PIX_FMT_SN9C10X: descr = "GSPCA SN9C10X"; break;
>> diff --git a/include/uapi/linux/videodev2.h
>> b/include/uapi/linux/videodev2.h index 262ef10cfa02..a7a7969ae4f8
>> 100644
>> --- a/include/uapi/linux/videodev2.h
>> +++ b/include/uapi/linux/videodev2.h
>> @@ -740,6 +740,7 @@ struct v4l2_pix_format { #define
>> V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed
>> slices */ #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /*
>HEVC parsed slices */
>> #define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark
>*/
>> +#define V4L2_PIX_FMT_RV v4l2_fourcc('R', 'V', '0', '0') /* RealMedia */
>>
>> /* Vendor-specific formats */
>> #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */