Discussion:
[FFmpeg-user] V210 is a packet format but ffmpeg shows always yuv422p10le (planar?) - or how to read a V210.raw stream with ffmpeg?
Christoph Gerstbauer
2015-05-21 08:37:34 UTC
Permalink
Hello

I am very confused about handling v210.
Different web pages show that v210 is a packed yuv 10bit format:

http://www.fourcc.org/yuv.php#V210
http://www.digitalpreservation.gov/formats/fdd/fdd000353.shtml
https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG8-V210__4_2_2_COMPRESSION_TYPE

But every time when I encode v210 or decode v210 ffmpeg shows me the
pixel format "yuv422p10le". (Video: v210 (v210 / 0x30313276), yuv422p10le)
But as far as I know the P at the end of yuv422p or yuv422p10le is a
hint that it is PLANAR, right?
Also the VLC player shows me at placback this info: Planar 4:2:2 YUV
10-bit LE
Or is p also meaned for packet?

I am asking this because I try to read a V210 RAW stream and ffmpeg need
te get defined which input pixelformat is coming in.
So in the past (1 year ago I think) I always set this syntax bevor the
inputfile: ffmpeg -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210
The final image result was damaged. Was there a fix in the meantime?
Because now it works, but only for one frame, and this frame is NOT damaged:

COMMAND LINE OUTPUT:
ffmpegnew -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210 -i
C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw -vcodec ffv
huff C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.avi
ffmpeg version N-72259-g0b9d636 Copyright (c) 2000-2015 the FFmpeg
developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme
--enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable
-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --ena
ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --e
nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 39.101 / 56. 39.101
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[image2 @ 000000000035f860] Format image2 detected only with low score
of 5, misdetection possible!
Input #0, image2, from
'C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: v210, yuv422p10le, 720x576, 25 tbr, 25 tbn, 25 tbc
Output #0, avi, to 'C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.avi':
Metadata:
ISFT : Lavf56.33.101
Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv422p10le,
720x576, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc56.39.101 ffvhuff
Stream mapping:
Stream #0:0 -> #0:0 (v210 (native) -> ffvhuff (native))
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=0.0 Lsize= 823kB time=00:00:00.04
bitrate=168643.6kbits/s
video:818kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.701023%

The RAW sample file can be downloaded here:
https://cerebrum.noa-audio.com/noacloud/index.php/apps/files/download/FFmpeg_User_MailingList/16x9_10bit_720x576_25fps_V210RAW.zip

Best Regards
Christoph
Carl Eugen Hoyos
2015-05-21 08:49:12 UTC
Permalink
Post by Christoph Gerstbauer
I am very confused about handling v210.
From FFmpeg pov, v210 is a codec just like
Prores or H.264 (with constant frame size,
so actually sunrast or targa).
Post by Christoph Gerstbauer
ffmpegnew -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210
-i C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw
How was this file produced?

You have to know the size of one frame ("1234"),
then please try:
$ cat 16x9.raw|ffmpeg -f image2pipe -frame_size 1234
-vcodec v210 -s pal -i - out.avi
No.

Carl Eugen
Carl Eugen Hoyos
2015-05-21 08:51:09 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Christoph Gerstbauer
ffmpegnew -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210
-i C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw
How was this file produced?
And even more important:
Which application reads such files?

Carl Eugen
Christoph Gerstbauer
2015-05-21 08:58:49 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Carl Eugen Hoyos
Post by Christoph Gerstbauer
ffmpegnew -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210
-i C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw
How was this file produced?
Which application reads such files?
Carl Eugen
This file was produced by VidChecker. It checks a (e.g.) APPLE PRO RES
10bit files, and corrects it if necessary, and puts the corrected RAW
file out.
I think there is a mainconcept encoder for thsi raw stream implemented
in this software.

No software will read this raw stream without giving it the right input
params.

But the point is not to read THIS raw stream, I mean it generally to
read A raw stream from any source which carriers v210 packet format.
I just needed a represantation raw file to show you my problem.
I need the grab a raw v210 stream from a video capture card to encode it
directly to ffvhuff. That is my usecase.

br
Christoph
Carl Eugen Hoyos
2015-05-21 09:12:26 UTC
Permalink
Post by Christoph Gerstbauer
I need the grab a raw v210 stream from a video capture
card to encode it directly to ffvhuff. That is my usecase.
The file you provided has nothing to do with this usecase
(I hope). The capture card supports an API and this API
is hopefully supported by FFmpeg (dshow).

Carl Eugen
Carl Eugen Hoyos
2015-05-21 09:13:20 UTC
Permalink
Post by Christoph Gerstbauer
This file was produced by VidChecker. It checks a (e.g.)
APPLE PRO RES 10bit files, and corrects it if necessary
I am curious:
What does it check and correct?
What feature is missing from FFmpeg?

Carl Eugen
Christoph Gerstbauer
2015-05-21 09:24:59 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Christoph Gerstbauer
This file was produced by VidChecker. It checks a (e.g.)
APPLE PRO RES 10bit files, and corrects it if necessary
What does it check and correct?
What feature is missing from FFmpeg?
Carl Eugen
You asked me how the RAW file was produced.
It was produced by VidChecker. I doesnt mather in this issue what
Vidchecker corrects (audio/videolevels).
It is just important to know that VidChecker is producing a RAW V210
stream file.
And this RAW stream file I want to handle for decoding.
Because I think: if I can handle a raw v210 stream, I can also handle a
raw v210 stream from a capture card.
The RAW v210 stream file is for pretesting for me, because I am no
programme who can work with API or SDKs.
Post by Carl Eugen Hoyos
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Carl Eugen Hoyos
2015-05-21 09:48:51 UTC
Permalink
Post by Christoph Gerstbauer
if I can handle a raw v210 stream, I can also
handle a raw v210 stream from a capture card.
The RAW v210 stream file is for pretesting for
me, because I am no programme who can work with
API or SDKs.
The FFmpeg programmers already worked with the API
that the capture card uses, you should be able to
record frames from the capture card without using
an intermediate file (that - as you found out - is
difficult to handle in the case of raw v210).

Carl Eugen
Christoph Gerstbauer
2015-05-21 09:02:30 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Christoph Gerstbauer
I am very confused about handling v210.
From FFmpeg pov, v210 is a codec just like
Prores or H.264 (with constant frame size,
so actually sunrast or targa).
Post by Christoph Gerstbauer
ffmpegnew -r 25 -s 720x576 -pix_fmt yuv422p10le -vcodec v210
-i C:\Users\gersti\Desktop\16x9_10bit_720x576_25fps.raw
How was this file produced?
You have to know the size of one frame ("1234"),
$ cat 16x9.raw|ffmpeg -f image2pipe -frame_size 1234
-vcodec v210 -s pal -i - out.avi
What defnies the SIZE of 1234? Bytes/Bits?
Am am not able to do "cat" on my windows machine. I have no linux.
Post by Carl Eugen Hoyos
No.
Sorry I forgot the link:
https://cerebrum.noa-audio.com/noacloud/index.php/apps/files/download/FFmpeg_User_MailingList/16x9_10bit_720x576_25fps_V210RAW.zip
Post by Carl Eugen Hoyos
Carl Eugen
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Moritz Barsnick
2015-05-21 09:08:59 UTC
Permalink
Post by Christoph Gerstbauer
Am am not able to do "cat" on my windows machine. I have no linux.
http://superuser.com/a/434876/361295

"type" :-)
Post by Christoph Gerstbauer
https://cerebrum.noa-audio.com/noacloud/index.php/apps/files/download/FFmpeg_User_MailingList/16x9_10bit_720x576_25fps_V210RAW.zip
No, you didn't. You forgot to give us your username and password,
because that's what that link prompt for.

Moritz
Carl Eugen Hoyos
2015-05-21 09:10:03 UTC
Permalink
Post by Christoph Gerstbauer
Post by Carl Eugen Hoyos
You have to know the size of one frame ("1234"),
$ cat 16x9.raw|ffmpeg -f image2pipe -frame_size 1234
-vcodec v210 -s pal -i - out.avi
What defnies the SIZE of 1234? Bytes/Bits?
Size of 16x9.raw / number of frames?
Post by Christoph Gerstbauer
Am am not able to do "cat" on my windows machine.
(type == cat)
Just do ffmpeg -f image2pipe ... -i 16x9.raw

Please leave an empty line between the quotes and your
answer, your emails are hard to read.

Carl Eugen
Christoph Gerstbauer
2015-05-21 09:47:05 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Christoph Gerstbauer
Post by Carl Eugen Hoyos
You have to know the size of one frame ("1234"),
$ cat 16x9.raw|ffmpeg -f image2pipe -frame_size 1234
-vcodec v210 -s pal -i - out.avi
What defnies the SIZE of 1234? Bytes/Bits?
Size of 16x9.raw / number of frames?
I tried this syntax, and it seems that it worked:

C:\Users\vnoa-auto>ffmpegnew -f image2pipe -vcodec v210 -s 720x576
-frame_size 1105920 -i
C:\Users\vnoa-auto\Desktop\16x9_10bit_720x576_25fps.raw -vco
dec ffvhuff C:\Users\vnoa-auto\Desktop\16x9_10bit_720x576_25fps.avi
ffmpeg version N-72259-g0b9d636 Copyright (c) 2000-2015 the FFmpeg
developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme
--enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable
-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --ena
ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --e
nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 39.101 / 56. 39.101
libavformat 56. 33.101 / 56. 33.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, image2pipe, from
'C:\Users\vnoa-auto\Desktop\16x9_10bit_720x576_25fps.raw':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: v210, yuv422p10le, 720x576, 25 fps, 25 tbr, 25
tbn, 25 tbc
File 'C:\Users\vnoa-auto\Desktop\16x9_10bit_720x576_25fps.avi' already
exists. Overwrite ? [y/N] y
Output #0, avi, to
'C:\Users\vnoa-auto\Desktop\16x9_10bit_720x576_25fps.avi':
Metadata:
ISFT : Lavf56.33.101
Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv422p10le,
720x576, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc56.39.101 ffvhuff
Stream mapping:
Stream #0:0 -> #0:0 (v210 (native) -> ffvhuff (native))
Press [q] to stop, [?] for help
frame= 250 fps=0.0 q=0.0 Lsize= 207188kB time=00:00:10.00
bitrate=169728.8kbits/s
video:207177kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.005584%


So if as I understand: for a specific resolution the framesize is always
the same in v210 raw?
In this case the framesize is "1105920". So, when I know the framerate
and the resolution of the v210 raw stream, I will know the framesize. right?

Best Regards
Christoph
Carl Eugen Hoyos
2015-05-21 09:53:39 UTC
Permalink
Post by Christoph Gerstbauer
So if as I understand: for a specific resolution
the framesize is always the same in v210 raw?
Very, very generally: No, this is the reason why
a decoder is needed: Some applications produce
an incorrect framesize for a given resolution.

But in the case of a given application, the
framesize has to be constant for a given
resolution: If it is not, the file cannot be read.

(And the framesize is of course defined by the
specification for a given resolution but as said,
some encoders use an incorrect stride.)

You can definitely use this syntax to read the
raw files from your capture card, but is should
be way easier to use -f dshow instead.

Carl Eugen
Christoph Gerstbauer
2015-05-21 10:26:36 UTC
Permalink
Post by Carl Eugen Hoyos
Very, very generally: No, this is the reason why
a decoder is needed: Some applications produce
an incorrect framesize for a given resolution.
But in the case of a given application, the
framesize has to be constant for a given
resolution: If it is not, the file cannot be read.
(And the framesize is of course defined by the
specification for a given resolution but as said,
some encoders use an incorrect stride.)
You can definitely use this syntax to read the
raw files from your capture card, but is should
be way easier to use -f dshow instead.
Yes, I could do this if our card would be supported (Decklink), but we
dont use Decklink cards. :/ We use DVS Cards.

ffmpeg supported devices for dshow:
[dshow @ 00000000003c6820] DirectShow video devices (some may be both
video and audio devices)
[dshow @ 00000000003c6820] "Logitech HD Webcam C525"
[dshow @ 00000000003c6820] Alternative name
"@device_pnp_\\?\usb#vid_046d&pid_0826&mi_02#7&1469f92a&3&0002#{65e8773d-8f56-11d0-a3b
[dshow @ 00000000003c6820] "Decklink Video Capture"
[dshow @ 00000000003c6820] Alternative name
"@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\{44A8B5C7-13B6-4211-BD40-35B629D9E6
[dshow @ 00000000003c6820] DirectShow audio devices
[dshow @ 00000000003c6820] "Microphone (HD Webcam C525)"
[dshow @ 00000000003c6820] Alternative name
"@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Microphone (HD Webcam
C525)"
[dshow @ 00000000003c6820] "Decklink Audio Capture"
[dshow @ 00000000003c6820] Alternative name
"@device_sw_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\{AAA22F7E-5AA0-49D9-8C8D-B52B1AA92E
[dshow @ 00000000003c6820] "Headset Microphone (4- Logitech"
[dshow @ 00000000003c6820] Alternative name
"@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Headset Microphone
(4- Logitech"
[dshow @ 00000000003c6820] "Realtek Digital Input (Realtek "
[dshow @ 00000000003c6820] Alternative name
"@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Realtek Digital Input
(Realtek "

Best Regards
Christoph
Roger Pack
2015-05-21 13:29:05 UTC
Permalink
Post by Christoph Gerstbauer
Post by Carl Eugen Hoyos
Very, very generally: No, this is the reason why
a decoder is needed: Some applications produce
an incorrect framesize for a given resolution.
But in the case of a given application, the
framesize has to be constant for a given
resolution: If it is not, the file cannot be read.
(And the framesize is of course defined by the
specification for a given resolution but as said,
some encoders use an incorrect stride.)
You can definitely use this syntax to read the
raw files from your capture card, but is should
be way easier to use -f dshow instead.
Yes, I could do this if our card would be supported (Decklink), but we
dont use Decklink cards. :/ We use DVS Cards.
video and audio devices)
C525)"
(4- Logitech"
(Realtek "
Is there anything lacking in the dshow support?

Carl Eugen Hoyos
2015-05-21 09:55:42 UTC
Permalink
-vcodec ffvhuff
Did I already ask why you are using ffvhuff?
Isnt't this an ancient codec without specification
or similar? And not even tested by the archiver
community?

Carl Eugen
Christoph Gerstbauer
2015-05-21 10:17:13 UTC
Permalink
Post by Carl Eugen Hoyos
Did I already ask why you are using ffvhuff?
Isnt't this an ancient codec without specification
or similar? And not even tested by the archiver
community?
No, you didnt ;)
I/we use this ffvhuff codec as internal working format (SD/HD/2K/4K
sources). The final archive format is generated from ffvhuff, and is FFV1.
We use ffvhuff because its faster, in future maybe we can use ffv1 instead.
Carl Eugen Hoyos
2015-05-21 10:51:59 UTC
Permalink
Post by Christoph Gerstbauer
We use ffvhuff because its faster
Thank you, I forgot that.

Carl Eugen
Christoph Gerstbauer
2015-05-21 09:17:48 UTC
Permalink
Post by Christoph Gerstbauer
No.
https://cerebrum.noa-audio.com/noacloud/index.php/apps/files/download/FFmpeg_User_MailingList/16x9_10bit_720x576_25fps_V210RAW.zip
this link should work better:
https://cerebrum.noa-audio.com/noacloud/public.php?service=files&t=3f9b02946f9f8cd4c60c3b71e8295892
wqmffmpeg
2015-05-21 09:27:33 UTC
Permalink
Dear all
I hava a issue
I want to Convert H.264 NAL format to annex b according to NAL unit length size
there is a function below, but only works for NAL sizes 3-4
Anyone could shed a light to me?
------------------------------------------------------------
/* This only works for NAL sizes 3-4 */
status_t convertNal2AnnexB(uint8_t *dst, size_t dst_size,
uint8_t *src, size_t src_size, size_t nal_len_size)
{
size_t i = 0;
size_t nal_len = 0;
status_t status = OK;

CHECK_EQ(dst_size, src_size);
CHECK(nal_len_size == 3 || nal_len_size == 4);

while (src_size >= nal_len_size) {
nal_len = 0;
for( i = 0; i < nal_len_size; i++ ) {
nal_len = (nal_len << 8) | src[i];
dst[i] = 0;
}
dst[nal_len_size - 1] = 1;
if (nal_len > INT_MAX || nal_len > src_size) {
status = ERROR_MALFORMED;
break;
}
dst += nal_len_size;
src += nal_len_size;
src_size -= nal_len_size;

memcpy(dst, src, nal_len);

dst += nal_len;
src += nal_len;
src_size -= nal_len;
}

return status;
}


2015-05-21

wqmffmpeg



ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Loading...