[Libav-user] Encoding problem using AV_PIX_FMT_YUV422P10

Dirr Bernhard Bernhard.Dirr at newtec.de
Tue Feb 17 10:18:36 CET 2015


Dear ffmpeg community,

I am using the libav... libraries to build a system that encodes V210
raw video images lossless to a video file on a FTP server.
The application compiles and runs on a CentOS 5 X86_64 Linux system.

Therefore I chose the nut container format as it does not require
"seeking" in output. Also the FFV1 codec was choosen with the
pixel format AV_PIX_FMT_YUV422P10 because this setting is supposed to
reproduce exactly the original YCbCr422-10bit components values
for Y, Cb and Cr.

The system is now running in so far, video format is 1920x1080p25.
The encoding and muxing produces video files, both local or on
a FTP server.

But playing this files with ffplay or with VLC player reveals
a problem. The frames seem to display only every other pixel line
correctly, the incorrect lines are rendered as uniform green pixels.

Tests with v210 codec, or with a local .mov file instead of FTP and
same pixel format showed the same problems.

I converted the video to images with:
ffmpeg -i testvideo.nut -f image2 img%05d.png
to separate images and analysed the pictures as follows:

The 1st 5 pixels of every line seem to have correct properties.
The 6th pixel of the "bad" pixel lines seems to have some other
color as it is the case with the very last pixel of the "good"
lines. The remaining pixels of the "bad" lines all have same
dark green color.

Please find attached the software modules
"VideoCoderTest.c", "VideoCoder.h" and "VideoCoder.c".
When the application is run, a file "testvideo.nut" should be
generated. "ffmpeg_libav.log" contains the command, which was used
to compile the test application. Further it shows the outputs of
execution.

Please view the image of the very 1st frame.
https://www.dropbox.com/s/h7u7bm0qgp93na4/img00001.png?dl=0

Questions - Where is my error?
Wrong initialization of format and codec contexts?
Wrong initialization of output stream?
Wrong allocation and usage of the AVFrame object?
Wrong parameters in format-, codec-, stream-contexts?
Wrong parameter setting in AVFrame object?
May be a timing problem between application and threads in libav?

Is there a general problem in using nut container with either v210
or ffv1 codecs for the above mentioned pixel format?

Every help using this great library is very appreciated.

May be, when my problems get solved, this test could be placed in
your "API examples" folder (after adding more comments by me).

Best regards
Bernhard Dirr
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: VideoCoder.cpp
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150217/f081a4b6/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: VideoCoder.h
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150217/f081a4b6/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: VideoCoderTest.c
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150217/f081a4b6/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg_libav.log
Type: application/octet-stream
Size: 2825 bytes
Desc: ffmpeg_libav.log
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150217/f081a4b6/attachment.obj>


More information about the Libav-user mailing list