Page 1 of 1

Incorrect video size and sampling rate video capture from HW board

Posted: 26 Jul 2016 11:18
by Kristop
Hello,

Trying to record in a file a video stream using a Datapath Capture board. Got some difficulties (crashes), finally got some results, but crooked.
The video stream is in HD 60Hz, and I record in the same format, using H264 codec, sampling rate around 20,000kbps. I had to define a bottom-up buffer in the input pin to prevent vlc from crashing.
What I get (using gspot to analyse the video charac):
- a recommended display size of 49500x1080 (down to 2560x1920 in my best attempt, but the video ratio was inverted: 1080x1920)
- video rates between 20 and 50kbps
- sometimes the video appears squeezed vertically in 100-200 pixels.
Other infos:
- on VLC 2.0.1, I can display the video stream (correctly, but inverted top-down at first) but not record (crash)
- on VLC 2.2.4, I can't display (nothing happens), but I can record.

I get some strange messages from vlc, that may help :
- (got firstly negative number of lines, -1080, which directed me to change the top-down/bottom-up parameter)
- now, there seems to be a problem in the chroma (I tried "autom", which seems to be RV24, and then YUy2), and others problems (messages below are exerpts from an attempt that gave a recommended display size of : 49052x1080 (and consistently a dar of 45.419), and a video rate of 42kbps ; the video looks ok except that it is highly compressed)
...
core debug: no meta fetcher modules matched
core debug: no art finder modules matched
...
dshow debug: EnumDeviceCaps: output pin: Capture
dshow debug: EnumDeviceCaps: output pin: Preview
dshow debug: EnumDeviceCaps: trying pin Capture
dshow debug: EnumDeviceCaps: input pin default format configured
dshow debug: EnumDeviceCaps: input pin accepts chroma: YUY2, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: UYVY, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: YVYU, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: RGB8, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: RV16, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: RV24, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin accepts chroma: RV32, width:1920, height:1080, fps:59.994121
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video YUY2)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video UYVY)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video YVYU)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video z?6?)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video {?6?)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video }?6?)
dshow debug: EnumDeviceCaps: input pin media: unsupported format (video ~?6?)

...
filter debug: CapturePin::QueryAccept [OK] (width=1920, height=1080, chroma=RV24, fps=59.994121)
filter debug: CapturePin::ReceiveConnection [OK] ...

dshow debug: ConnectFilters: graph_builder2 available.
dshow warning: ConnectFilters: No crossBar routes found (incompatible pin types)
dshow debug: filters connected successfully !
dshow debug: configuring Device Properties
dshow debug: showing WDM Video Configuration Pages
filter debug: CapturePin::QueryAccept [OK] (width=1920, height=-1080, chroma=RV24, fps=59.994121)
filter debug: CapturePin::Disconnect [OK]
filter debug: CapturePin::QueryDirection
filter debug: CapturePin::QueryAccept [OK] (width=1920, height=-1080, chroma=RV24, fps=59.994121)
filter debug: CapturePin::ReceiveConnection [OK]
...
dshow debug: MEDIATYPE_Video
dshow debug: selected video pin accepts format: RV24
...
stream_out_transcode debug: creating video transcoding from fcc=`RV24' to fcc=`h264'
...
core debug: looking for meta reader module matching "any": 2 candidates
lua debug: Trying Lua scripts in C:\Users\apogee\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader\filename.luac
core debug: no meta reader modules matched
...
core debug: using encoder module "x264"
core debug: removing module "x264"
x264 debug: framecount still in libx264 buffer: 0
x264 info: final ratefactor: 70.10
...
core debug: Stream buffering done (300 ms in 303 ms)
core debug: Decoder wait done in 0 ms
stream_out_transcode debug: decoder aspect is 441867.285597:1
stream_out_transcode debug: source pixel aspect is 248550.345703:1
stream_out_transcode debug: scaled pixel aspect is 248550.343750:1
stream_out_transcode debug: source 1920x1080, destination 1920x1080
stream_out_transcode debug: source fps 10000000/166683, destination 60/1
stream_out_transcode info: input interval 16668 (base 166683)
stream_out_transcode info: output interval 16666 (base 1)
stream_out_transcode debug: encoder aspect is -259200:145800
...

Any idea ?

Thanks

Re: Incorrect video size and sampling rate video capture from HW board

Posted: 27 Jul 2016 18:40
by Kristop
I've cleared one part of the problem (no more crossbar error by installing the kernel mode of the capture board), but it remains a big problem:
- if I set the bottom-up buffer option, a video is recorded, but the aspect ratio is wrong:
* all other software than vlc cannot read the file, and gives an aspect ratio of 45:1 !
* even vlc gives error or strange messages while generating the video, such as:
- "filter debug: CapturePin::QueryAccept [OK] (width=1920, height=-1080, chroma=RV24, fps=59.930121)" : with a negative -1080, probably because of the bottom-up option
- stream_out_transcode debug: decoder aspect is 441867.285597:1
stream_out_transcode debug: source pixel aspect is 248550.345703:1
stream_out_transcode debug: scaled pixel aspect is 248550.343750:1
stream_out_transcode debug: source 1920x1080, destination 1920x1080
stream_out_transcode debug: source fps 10000000/166861, destination 10000000/166861
stream_out_transcode debug: encoder aspect is -259200:145800
swscale debug: 1920x1080 (1920x1080) chroma: RV24 -> 1920x1080 (1920x1080) chroma: I420 with scaling using Bicubic (good quality)
core debug: using video filter2 module "swscale"
core debug: Filter 'Swscale' (05bf7694) appended to chain
stream_out_transcode debug: destination (after video filters) 1920x1080
x264 warning: cannot create valid sample aspect ratio
- if I set the top-down buffer option, vlc prompts this error: "it seems your libav/FFmpeg (libavcoedc) installation lacks the following encoder: H264 - MPEG-4 AVC (part 10)." Message that I don't understand, still codecs are installed with vlc... (why vlc doesn't use here X264 as in the other case ?)

Note: the raw video recording does not work here : "core error: failed to create video output"

Does anyone have an idea ?

Re: Incorrect video size and sampling rate video capture from HW board

Posted: 28 Jul 2016 21:57
by Jean-Baptiste Kempf
This is a clear bug in VLC.

Re: Incorrect video size and sampling rate video capture from HW board

Posted: 29 Jul 2016 11:56
by Kristop
For information, I tried the YUY2 option, and this one works (there is no bottom_up/top_down option in this case).