Hi Folks,
I was trying to encode video from web-camera on BB using gstreamer TI
codec and got some problems. Since it is more related to TI's plugin,
I post the complete problem description to their forum:
https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=ForumMessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
But if someone here has an idea what might be wrong, I would highly
appreciate any tips.
Thank you,
Andrey.
Hi,
Is it possible that you have an MJPEG camera in which case you need to put an
jpeg decoder after your 'v4l2src' element?
Regards,
Caglar
Andrey Nechypurenko wrote:
Hi Folks,
I was trying to encode video from web-camera on BB using gstreamer TI
codec and got some problems. Since it is more related to TI's plugin,
I post the complete problem description to their forum:
https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=ForumMessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
But if someone here has an idea what might be wrong, I would highly
appreciate any tips.
and it works if you don't include "ffmpegcolorspace"?
from the error message: "OM - Memory_getBufferPhysicalAddress>
invalid buffer size provided (0)" my guess is that by including
ffmpegcolorspace you somehow end up not giving a CMEM buffer to
the encoder any more and then CE complains as it cannot get the
physical address to give to the dsp...
Hi Caglar,
Hi Folks,
I was trying to encode video from web-camera on BB using gstreamer TI
codec and got some problems. Since it is more related to TI's plugin,
I post the complete problem description to their forum:
https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=Forum
MessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
But if someone here has an idea what might be wrong, I would highly
appreciate any tips.
Thank you,
Andrey.
Hi,
Is it possible that you have an MJPEG camera in which case you need to put an
jpeg decoder after your 'v4l2src' element?
I was trying 4 cameras and none of them works. One of them is Logitec
9000Pro and I will definitely try your tip. Thanks!
However, as I mentioned in the post by TI forum, it is
ffmpegcolorspace filter in front of TIVidenc1 which always cause
TIVidenc1 to fail. Even using videotestsrc which actually works
without ffmpegcolorspace because it can provide frames in one of the
three formats supported by TIVidenc1.
So even if your suggestion with jpeg decoder will work I would
consider it as a workaround the problem with ffmpegcolorspace together
with TIVidenc1.
Thank you!
Andrey.
Andrey Nechypurenko wrote:
Hi Folks,
I was trying to encode video from web-camera on BB using gstreamer TI
codec and got some problems. Since it is more related to TI's plugin,
I post the complete problem description to their forum:
https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=ForumMessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
But if someone here has an idea what might be wrong, I would highly
appreciate any tips.
and it works if you don't include "ffmpegcolorspace"?
Right. The following pipeline works just fine:
gst-launch -v videotestsrc ! video/x-raw-yuv, width=320, height=240,
framerate=\(fraction\)30/1 ! TIVidenc1 codecName=h264enc
engineName=codecServer ! filesink location=sample.264
However, adding ffmpegcolorspace in front of TIVidenc1 triggers the
error. But in my case ffmpegcolorspace is unavoidable since my camera
(v4l2src) does not support one of the three formats (UYVY, Y8C8 or
NV12) supported by TIVidenc1.
from the error message: "OM - Memory_getBufferPhysicalAddress>
invalid buffer size provided (0)" my guess is that by including
ffmpegcolorspace you somehow end up not giving a CMEM buffer to
the encoder any more and then CE complains as it cannot get the
physical address to give to the dsp...
It might be true... I can not really judge
. Do you have an idea
how solve this problem?
Thank you,
Andrey.
Hi Caglar,
>> Hi Folks,
>>
>> I was trying to encode video from web-camera on BB using gstreamer TI
>> codec and got some problems. Since it is more related to TI's plugin,
>> I post the complete problem description to their forum:
>>
>> https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=Fo
>>rum MessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
>>
>> But if someone here has an idea what might be wrong, I would highly
>> appreciate any tips.
>>
>> Thank you,
>> Andrey.
>
> Hi,
>
> Is it possible that you have an MJPEG camera in which case you need to
> put an jpeg decoder after your 'v4l2src' element?
I was trying 4 cameras and none of them works. One of them is Logitec
9000Pro and I will definitely try your tip. Thanks!
However, as I mentioned in the post by TI forum, it is
ffmpegcolorspace filter in front of TIVidenc1 which always cause
TIVidenc1 to fail. Even using videotestsrc which actually works
without ffmpegcolorspace because it can provide frames in one of the
three formats supported by TIVidenc1.
So even if your suggestion with jpeg decoder will work I would
consider it as a workaround the problem with ffmpegcolorspace together
with TIVidenc1.
No it is not a workaround, if this is the case, because your camera outputs
encoded images hence you need a decoder element before ffmpegcolorspace.
The problem with ffmpegcolorspace is, it is en expensive operation and should
be avoided where possible. OTH, did you try putting caps after
ffmpegcolorspace so that it will know which format to convert without
negotiating with TiVidenc1?
Regards,
Caglar
Hi Caglar,
>> Hi Folks,
>>
>> I was trying to encode video from web-camera on BB using gstreamer TI
>> codec and got some problems. Since it is more related to TI's plugin,
>> I post the complete problem description to their forum:
>>
>> https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=Fo
>>rum MessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
>>
>> But if someone here has an idea what might be wrong, I would highly
>> appreciate any tips.
>>
>> Thank you,
>> Andrey.
>
> Hi,
>
> Is it possible that you have an MJPEG camera in which case you need to
> put an jpeg decoder after your 'v4l2src' element?
I was trying 4 cameras and none of them works. One of them is Logitec
9000Pro and I will definitely try your tip. Thanks!
However, as I mentioned in the post by TI forum, it is
ffmpegcolorspace filter in front of TIVidenc1 which always cause
TIVidenc1 to fail. Even using videotestsrc which actually works
without ffmpegcolorspace because it can provide frames in one of the
three formats supported by TIVidenc1.
So even if your suggestion with jpeg decoder will work I would
consider it as a workaround the problem with ffmpegcolorspace together
with TIVidenc1.
No it is not a workaround, if this is the case, because your camera outputs
encoded images hence you need a decoder element before ffmpegcolorspace.
Well, by workaround I mean that this solution will eliminate the need
for ffmpegcolorspace at all. So it does not solve the problem with
ffmpegcolorspace talking to TIVidenc1. But it will probably let me
move further and I will definitely try it later today. So once again
thanks for the suggestion.
The problem with ffmpegcolorspace is, it is en expensive operation and should
be avoided where possible.
Sure. I am totally agree. But do you think that jpeg decoding is
faster? Probably TI DSP based decoder can be used... I will definitely
try this way.
OTH, did you try putting caps after
ffmpegcolorspace so that it will know which format to convert without
negotiating with TiVidenc1?
No I did not. There were no errors with negotiation so I did not get
such idea. Will also try it.
Thanks!
Andrey.
Andrey Nechypurenko wrote:
Hi Caglar,
>> Hi Folks,
>>
>> I was trying to encode video from web-camera on BB using gstreamer TI
>> codec and got some problems. Since it is more related to TI's plugin,
>> I post the complete problem description to their forum:
>>
>> https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=Fo
>>rum MessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
>>
>> But if someone here has an idea what might be wrong, I would highly
>> appreciate any tips.
>>
>> Thank you,
>> Andrey.
>
> Hi,
>
> Is it possible that you have an MJPEG camera in which case you need to
> put an jpeg decoder after your 'v4l2src' element?
well, you should be able to see something encoded, even if in the wrong color format.
if what you encoded looks like random garbage, then the camera could indeed deliver
MJPG. if it looks like what you expect (albeit with totally wrong colors) then
your camera outputs raw data...
I was trying 4 cameras and none of them works. One of them is Logitec
9000Pro and I will definitely try your tip. Thanks!
However, as I mentioned in the post by TI forum, it is
ffmpegcolorspace filter in front of TIVidenc1 which always cause
TIVidenc1 to fail. Even using videotestsrc which actually works
without ffmpegcolorspace because it can provide frames in one of the
three formats supported by TIVidenc1.
So even if your suggestion with jpeg decoder will work I would
consider it as a workaround the problem with ffmpegcolorspace together
with TIVidenc1.
No it is not a workaround, if this is the case, because your camera outputs
encoded images hence you need a decoder element before ffmpegcolorspace.
Well, by workaround I mean that this solution will eliminate the need
for ffmpegcolorspace at all. So it does not solve the problem with
ffmpegcolorspace talking to TIVidenc1. But it will probably let me
move further and I will definitely try it later today. So once again
thanks for the suggestion.
The problem with ffmpegcolorspace is, it is en expensive operation and should
be avoided where possible.
Sure. I am totally agree. But do you think that jpeg decoding is
faster? Probably TI DSP based decoder can be used... I will definitely
try this way.
this is not a tradeoff between jpg decoding and color space conversion, one
is needed for a MPJEG camera, the other for one that outputs raw YUV data.
which one do you have?
OTH, did you try putting caps after
ffmpegcolorspace so that it will know which format to convert without
negotiating with TiVidenc1?
No I did not. There were no errors with negotiation so I did not get
such idea. Will also try it.
I doubt that is the issue, as I said, most likely the conversion does
not manage to use CMEM allocated buffers...
Andrey Nechypurenko wrote:
Hi Caglar,
>> Hi Folks,
>>
>> I was trying to encode video from web-camera on BB using gstreamer
TI
>> codec and got some problems. Since it is more related to TI's
plugin,
>> I post the complete problem description to their forum:
>>
>>
https://gstreamer.ti.com/gf/project/gstreamer_ti/forum/?_forum_action=Fo
>>rum MessageBrowse&thread_id=3251&action=ForumBrowse&forum_id=187
>>
>> But if someone here has an idea what might be wrong, I would highly
>> appreciate any tips.
>>
>> Thank you,
>> Andrey.
>
> Hi,
>
> Is it possible that you have an MJPEG camera in which case you need
to
> put an jpeg decoder after your 'v4l2src' element?
well, you should be able to see something encoded, even if in the wrong
color format.
if what you encoded looks like random garbage, then the camera could indeed
deliver
MJPG. if it looks like what you expect (albeit with totally wrong colors)
then
your camera outputs raw data...
As mentioned right below, I was playing with four different cameras.
One of them indeed delivers MJPG. But the error remains the same
independent from the camera. Even without camera using videotestsrc.
I was trying 4 cameras and none of them works. One of them is Logitec
9000Pro and I will definitely try your tip. Thanks!
However, as I mentioned in the post by TI forum, it is
ffmpegcolorspace filter in front of TIVidenc1 which always cause
TIVidenc1 to fail. Even using videotestsrc which actually works
without ffmpegcolorspace because it can provide frames in one of the
three formats supported by TIVidenc1.
So even if your suggestion with jpeg decoder will work I would
consider it as a workaround the problem with ffmpegcolorspace together
with TIVidenc1.
No it is not a workaround, if this is the case, because your camera
outputs
encoded images hence you need a decoder element before ffmpegcolorspace.
Well, by workaround I mean that this solution will eliminate the need
for ffmpegcolorspace at all. So it does not solve the problem with
ffmpegcolorspace talking to TIVidenc1. But it will probably let me
move further and I will definitely try it later today. So once again
thanks for the suggestion.
The problem with ffmpegcolorspace is, it is en expensive operation and
should
be avoided where possible.
Sure. I am totally agree. But do you think that jpeg decoding is
faster? Probably TI DSP based decoder can be used... I will definitely
try this way.
this is not a tradeoff between jpg decoding and color space conversion, one
is needed for a MPJEG camera, the other for one that outputs raw YUV data.
which one do you have?
I would prefer to use non mjpeg camera. So as I understand
ffmpegcolorspace would be unavoidable for me.
OTH, did you try putting caps after
ffmpegcolorspace so that it will know which format to convert without
negotiating with TiVidenc1?
No I did not. There were no errors with negotiation so I did not get
such idea. Will also try it.
I doubt that is the issue, as I said, most likely the conversion does
not manage to use CMEM allocated buffers...
Do you have an idea how to solve this problem? I think it is pretty
odd problem since there is not too much cameras which can naively
deliver UYVY. But without working colorspace conversion no other
cameras can be used (probably except those delivering mjpeg assuming
that it could be decompressed in UYVY format and thus avoiding
colorspace conversion).
Thanks,
Andrey.
Andrey Nechypurenko wrote:
Sure. I am totally agree. But do you think that jpeg decoding is
faster? Probably TI DSP based decoder can be used... I will definitely
try this way.
this is not a tradeoff between jpg decoding and color space conversion, one
is needed for a MPJEG camera, the other for one that outputs raw YUV data.
which one do you have?
I would prefer to use non mjpeg camera. So as I understand
ffmpegcolorspace would be unavoidable for me.
OTH, did you try putting caps after
ffmpegcolorspace so that it will know which format to convert without
negotiating with TiVidenc1?
No I did not. There were no errors with negotiation so I did not get
such idea. Will also try it.
I doubt that is the issue, as I said, most likely the conversion does
not manage to use CMEM allocated buffers...
Do you have an idea how to solve this problem? I think it is pretty
odd problem since there is not too much cameras which can naively
deliver UYVY. But without working colorspace conversion no other
cameras can be used (probably except those delivering mjpeg assuming
that it could be decompressed in UYVY format and thus avoiding
colorspace conversion).
normally, I would use the "looking at the source code" approach.
Just want to say that finally I get it work. The following pipeline
produces sample.264 file which I was able to playback with mplayer.
Camera used is Philips (pwc module):
gst-launch -v v4l2src ! video/x-raw-yuv, width=320, height=240,
framerate=\(fraction\)30/1 ! ffmpegcolorspace ! video/x-raw-yuv,
format=\(fourcc\)UYVY ! TIVidenc1 codecName=
h264enc engineName=codecServer ! filesink location=sample.264
The missing part was
! video/x-raw-yuv, format=\(fourcc\)UYVY ! between ffmpegcolorspace
and TIVidenc1.
Thank you very much for everybody for comments and answers to my question.
Andrey.