This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: H.264 encode quality problem

Part Number: AM5728

Tool/software: Linux

Hello,

I tried the command :gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=50000io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc bitrate = 10000 level=level-51 profile=high ! queue ! h264parse ! avimux ! filesink location = x.avi

it accured a problem:

And I tried the command :gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=50000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=128 ! queue ! ducatih264enc bitrate = 10000 level=level-51 profile=high ! queue ! h264parse ! avimux ! filesink location = x.avi

It accured the same problem.

However, I used the command :gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! videoconvert ! queue ! ducatih264enc bitrate = 10000 level=level-51 profile=high ! queue ! h264parse ! avimux ! filesink location = x.avi

It workded well!

So I think that it is because of the vpe plugin which  account for the problem?

And another problem is that I set the ducatih264enc's property  bitrate=10000.But I found that the encode file bitrate was not 10000.

The  bitrate was not steady.Sometimes it was more than 10000,and at some time it was less than 10000.

So could u help to set the encode file to set the corret bitrate .

I tried these commands on the AM5728 evm with sdk4.1.

And I have saw the website which have the so similar problem as me.

but it did not help my issues.

So could u help me to solve these problems?

Thanks&Regards!

  • The software team have been notified. They will respond here.
  • Hello,

    hsg said:
    I tried the command :gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=50000io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc bitrate = 10000 level=level-51 profile=high ! queue ! h264parse ! avimux ! filesink location = x.avi

    1. You could specify the cma pool size in kernel bootargs as cma=64M. You could try cma=128M and encoder level=40/level41.

    You could try with the latest PSDK also.

    hsg said:
    The  bitrate was not steady.Sometimes it was more than 10000,and at some time it was less than 10000.

    The bitrate depends how complex are the scenes in the video.

    I would recommend you to check VBR in the h264enc user guide.

    Hope this helps.

    BR
    Margarita

  • Hello,
    I used the latest PSDK 4.1.And could u give me the h264enc user guide.
    Thanks&regards!
  • Hello,
    I used the command:gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! \
    queue ! ducatimpeg4enc bitrate=4000 ! queue ! mpeg4videoparse ! qtmux ! filesink location=x.mp4
    form this website:processors.wiki.ti.com/.../Processor_Training:_Multimedia
    And I found the framerate of the encode file was 22.
    Then I tried my own command:
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc level=41 profile=high bitrate = 10000 ! queue ! h264parse ! 'video/x-h264, stream-format=byte-stream, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! avimux ! filesink location = x.avi
    I found that the encode file had the corret framerate(30) which I set.However, the encode video playback speeder up than what I captured.
    Could u give some advice to resolve the problem.
    Thanks&regards!
  • Hello,

    hsg said:
    I used the latest PSDK 4.1.And could u give me the h264enc user guide.

    The latest PSDK is 4.02.

    Here is the link to the codecs:

    https://git.ti.com/ivimm/ipumm/trees/master/extrel/ti/ivahd_codecs/packages/ti/sdo/codecs

    under folder docs you could find the user guides.

    hsg said:
    However, the encode video playback speeder up than what I captured.

    Do you mean that when you decoding the video, it is played "faster"? If yes, please set sync=true.

    BR
    Margarita

  • Hello,
    I don't really understand this(set sync true).Could tell me specificly.
    Thanks&regards!
  • Hello,

    I do not understand what you mean by the second sentence " I found that the encode file had the corret framerate(30) which I set.However, the encode video playback speeder up than what I captured."
    Per my understanding you are decoding the file but it is played faster so I recommend you to set waylandsink sync=true or kmssink sync=true in the decoding pipeline. Or element videorate could be use also.

    BR
    Margarita
  • Hello Margarita,
    I test this command on my side:
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc ! filesink location = y.264
    I found that the y.264 played faster. So I think that the problem is caused by the ducatih264enc ?
    Could u try the encode pipleline on your side and give me some advice?
    Thanks&regards!
  • Hello,

    What is the decoding pipeline that you are using?
    I more note you should add h264parse element between enc and filesink.
    ducatih264enc ! h264parse ! filesink location = y.264

    BR
    Margarita
  • Hello,
    My decode pipeline is :gst-launch-1.0 filesrc location=x.avi ! avidemux ! queue ! h264parse ! ducatih264dec ! kmssink sync=true
    And I'm sure the phenomenon was caused by the encode pipeline.Because I used the windows media palyer to decode the video.
    So could u give me some solutions to solve the problem.
    Thanks&regards!
  • Hello,

    I tried the encoding pipeline.
    gst-launch-1.0 videotestsrc num-buffers=1000 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc ! h264parse ! avimux ! filesink location = y.avi

    decoding:
    gst-launch-1.0 filesrc location=y.avi ! avidemux ! queue ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fpsdisplaysink sync=true -v

    output:
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 48, dropped: 0, current: 30.01, average: 30.75
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 63, dropped: 0, current: 29.77, average: 30.51
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 63, dropped: 0, current: 29.77, average: 30.51
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 78, dropped: 0, current: 29.72, average: 30.36
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 78, dropped: 0, current: 29.72, average: 30.36


    I tried the same but with 15 fps here is the output:
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 26, dropped: 0, current: 14.56, average: 15.89
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 34, dropped: 0, current: 15.21, average: 15.72
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 34, dropped: 0, current: 15.21, average: 15.72
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 42, dropped: 0, current: 15.36, average: 15.65

    BR
    Margarita
  • Hello,
    I tried the encoding pipeline.
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! tee name=t ! queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! avimux ! filesink location=x.avi t. ! queue ! fpsdisplaysink -v
    output:
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 10, dropped: 3, fps: 19.25, drop rate: 5.77
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 10, dropped: 3, fps: 19.25, drop rate: 5.77
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 17, dropped: 7, fps: 12.71, drop rate: 7.27
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 7, fps: 12.71, drop rate: 7.27
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 27, dropped: 9, fps: 19.44, drop rate: 3.89
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 27, dropped: 9, fps: 19.44, drop rate: 3.89
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 39, dropped: 9, current: 22.10, average: 18.33
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 39, dropped: 9, current: 22.10, average: 18.33
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 50, dropped: 10, fps: 20.44, drop rate: 1.86
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 50, dropped: 10, fps: 20.44, drop rate: 1.86
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 62, dropped: 10, current: 23.32, average: 19.50
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 62, dropped: 10, current: 23.32, average: 19.50
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 74, dropped: 10, current: 22.29, average: 19.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 74, dropped: 10, current: 22.29, average: 19.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 86, dropped: 10, current: 22.09, average: 20.18
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 86, dropped: 10, current: 22.09, average: 20.18
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 97, dropped: 11, fps: 20.66, drop rate: 1.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 97, dropped: 11, fps: 20.66, drop rate: 1.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 109, dropped: 11, current: 23.08, average: 20.51
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 109, dropped: 11, current: 23.08, average: 20.51
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 121, dropped: 11, current: 22.08, average: 20.66
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 121, dropped: 11, current: 22.08, average: 20.66
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 133, dropped: 11, current: 22.41, average: 20.80


    Then I used the command :
    gst-launch-1.0 filesrc location=x.avi ! avidemux ! queue ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fpsdisplaysink sync=true -v

    output:
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 17, dropped: 0, current: 32.85, average: 32.85
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 0, current: 32.85, average: 32.85
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 33, dropped: 0, current: 30.07, average: 31.44
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 33, dropped: 0, current: 30.07, average: 31.44
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 48, dropped: 0, current: 29.77, average: 30.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 48, dropped: 0, current: 29.77, average: 30.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 63, dropped: 0, current: 29.76, average: 30.62
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 63, dropped: 0, current: 29.76, average: 30.62
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 78, dropped: 0, current: 29.76, average: 30.45
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 78, dropped: 0, current: 29.76, average: 30.45
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 94, dropped: 0, current: 30.06, average: 30.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 94, dropped: 0, current: 30.06, average: 30.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 109, dropped: 0, current: 29.76, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 109, dropped: 0, current: 29.76, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 124, dropped: 0, current: 29.77, average: 30.23
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 124, dropped: 0, current: 29.77, average: 30.23
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 139, dropped: 0, current: 29.78, average: 30.18
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 139, dropped: 0, current: 29.78, average: 30.18
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 155, dropped: 0, current: 31.39, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 155, dropped: 0, current: 31.39, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 170, dropped: 0, current: 29.76, average: 30.25
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 170, dropped: 0, current: 29.76, average: 30.25
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 185, dropped: 0, current: 29.76, average: 30.21
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 185, dropped: 0, current: 29.76, average: 30.21
  • Hello,

    The fps of encoded file seems to be 30.
    But I am not sure that the pipeline with the tee element is correct, you should add kmssink or waylandsink for videosink element.

    BR
    Margarita
  • Hello,
    I'm sure the tee element is correct.And maybe I found the reason of the problem.
    1. I tested the encode pipeline with 30fps:
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! tee name=t ! queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! avimux ! filesink location=x.avi t. ! queue ! fpsdisplaysink -v

    output:/GstPipeline:pipeline0/GstAviMux:avimux0.GstPad:src: caps = video/x-msvideo
    /GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-msvideo
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 9, dropped: 4, fps: 17.46, drop rate: 7.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9, dropped: 4, fps: 17.46, drop rate: 7.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 15, dropped: 8, fps: 11.84, drop rate: 7.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 15, dropped: 8, fps: 11.84, drop rate: 7.90
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 24, dropped: 11, fps: 17.39, drop rate: 5.80
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 24, dropped: 11, fps: 17.39, drop rate: 5.80
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 35, dropped: 12, fps: 21.11, drop rate: 1.92
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 35, dropped: 12, fps: 21.11, drop rate: 1.92
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 47, dropped: 12, current: 22.06, average: 18.05
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 47, dropped: 12, current: 22.06, average: 18.05
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 59, dropped: 12, current: 22.57, average: 18.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 59, dropped: 12, current: 22.57, average: 18.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 70, dropped: 13, fps: 20.29, drop rate: 1.84
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 70, dropped: 13, fps: 20.29, drop rate: 1.84
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 81, dropped: 14, fps: 21.32, drop rate: 1.94
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 81, dropped: 14, fps: 21.32, drop rate: 1.94
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 93, dropped: 14, current: 22.22, average: 19.65
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 93, dropped: 14, current: 22.22, average: 19.65
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 105, dropped: 14, current: 22.90, average: 19.97

    as u can see,its capture fps was around 22.

    2.Then I used the decode pipeline to decode the video file(x.avi)
    :gst-launch-1.0 filesrc location=x.avi ! avidemux ! queue ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fpsdisplaysink sync=true -v

    output:
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 17, dropped: 0, current: 33.39, average: 33.39
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 0, current: 33.39, average: 33.39
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 32, dropped: 0, current: 29.12, average: 31.24
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 32, dropped: 0, current: 29.12, average: 31.24
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 47, dropped: 0, current: 29.77, average: 30.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 47, dropped: 0, current: 29.77, average: 30.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 63, dropped: 0, current: 30.03, average: 30.57
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 63, dropped: 0, current: 30.03, average: 30.57
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 78, dropped: 0, current: 29.75, average: 30.41
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 78, dropped: 0, current: 29.75, average: 30.41
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 93, dropped: 0, current: 29.76, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 93, dropped: 0, current: 29.76, average: 30.30
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 108, dropped: 0, current: 29.78, average: 30.23
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 108, dropped: 0, current: 29.78, average: 30.23
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 124, dropped: 0, current: 31.44, average: 30.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 124, dropped: 0, current: 31.44, average: 30.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 139, dropped: 0, current: 29.76, average: 30.31
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 139, dropped: 0, current: 29.76, average: 30.31
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 154, dropped: 0, current: 29.78, average: 30.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 154, dropped: 0, current: 29.78, average: 30.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 169, dropped: 0, current: 29.74, average: 30.21
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 169, dropped: 0, current: 29.74, average: 30.21
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 185, dropped: 0, current: 30.75, average: 30.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 185, dropped: 0, current: 30.75, average: 30.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 200, dropped: 0, current: 29.74, average: 30.22
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 200, dropped: 0, current: 29.74, average: 30.22
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 215, dropped: 0, current: 29.78, average: 30.19
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 215, dropped: 0, current: 29.78, average: 30.19
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 230, dropped: 0, current: 29.74, average: 30.16
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 230, dropped: 0, current: 29.74, average: 30.16

    as u can see,its fps was about 30. So it palyed faster than I captured!

    3.Then I tested another encode pipeline with 10fps.
    :gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1' ! vpe num-input-buffers=8 ! tee name=t ! queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! avimux ! filesink location=y.avi t. ! queue ! fpsdisplaysink -v

    output:/GstPipeline:pipeline0/GstAviMux:avimux0.GstPad:src: caps = video/x-msvideo
    /GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-msvideo
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 10, dropped: 3, fps: 19.38, drop rate: 5.82
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 10, dropped: 3, fps: 19.38, drop rate: 5.82
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 15, dropped: 8, fps: 9.64, drop rate: 9.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 15, dropped: 8, fps: 9.64, drop rate: 9.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 26, dropped: 10, fps: 20.00, drop rate: 3.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 26, dropped: 10, fps: 20.00, drop rate: 3.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 38, dropped: 10, current: 22.21, average: 17.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 38, dropped: 10, current: 22.21, average: 17.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 50, dropped: 10, current: 22.35, average: 18.78
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 50, dropped: 10, current: 22.35, average: 18.78
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 62, dropped: 10, current: 22.14, average: 19.35
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 62, dropped: 10, current: 22.14, average: 19.35
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 72, dropped: 12, fps: 18.71, drop rate: 3.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 72, dropped: 12, fps: 18.71, drop rate: 3.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 82, dropped: 14, fps: 19.16, drop rate: 3.83
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 82, dropped: 14, fps: 19.16, drop rate: 3.83
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 93, dropped: 15, fps: 21.28, drop rate: 1.93
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 93, dropped: 15, fps: 21.28, drop rate: 1.93
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 105, dropped: 15, current: 22.16, average: 19.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 105, dropped: 15, current: 22.16, average: 19.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 116, dropped: 16, fps: 20.60, drop rate: 1.87
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 116, dropped: 16, fps: 20.60, drop rate: 1.87
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 128, dropped: 16, current: 22.36, average: 20.03
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 128, dropped: 16, current: 22.36, average: 20.03
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 140, dropped: 16, current: 23.03, average: 20.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 140, dropped: 16, current: 23.03, average: 20.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 152, dropped: 16, current: 22.32, average: 20.41
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 152, dropped: 16, current: 22.32, average: 20.41
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 164, dropped: 16, current: 22.29, average: 20.54
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 164, dropped: 16, current: 22.29, average: 20.54
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 176, dropped: 16, current: 22.14, average: 20.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 176, dropped: 16, current: 22.14, average: 20.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 187, dropped: 17, fps: 20.32, drop rate: 1.85
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 187, dropped: 17, fps: 20.32, drop rate: 1.85
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 198, dropped: 18, fps: 21.47, drop rate: 1.95
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 198, dropped: 18, fps: 21.47, drop rate: 1.95
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 210, dropped: 18, current: 22.08, average: 20.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 210, dropped: 18, current: 22.08, average: 20.74
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 221, dropped: 19, fps: 20.66, drop rate: 1.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 221, dropped: 19, fps: 20.66, drop rate: 1.88
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 233, dropped: 19, current: 22.34, average: 20.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 233, dropped: 19, current: 22.34, average: 20.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 245, dropped: 19, current: 23.02, average: 20.91
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 245, dropped: 19, current: 23.02, average: 20.91
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 257, dropped: 19, current: 22.40, average: 20.98
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 257, dropped: 19, current: 22.40, average: 20.98

    Strangely,its capture fps was also about 22.

    4.decode the y.avi file:
    gst-launch-1.0 filesrc location=x.avi ! avidemux ! queue ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fpsdisplaysink sync=true -v

    output:
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 7, dropped: 0, current: 13.47, average: 13.47
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 7, dropped: 0, current: 13.47, average: 13.47
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 12, dropped: 0, current: 9.91, average: 11.72
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 12, dropped: 0, current: 9.91, average: 11.72
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 17, dropped: 0, current: 9.89, average: 11.11
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 0, current: 9.89, average: 11.11
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 23, dropped: 0, current: 10.21, average: 10.86
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 23, dropped: 0, current: 10.21, average: 10.86
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 28, dropped: 0, current: 9.72, average: 10.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 28, dropped: 0, current: 9.72, average: 10.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 34, dropped: 0, current: 9.90, average: 10.50
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 34, dropped: 0, current: 9.90, average: 10.50
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 40, dropped: 0, current: 10.21, average: 10.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 40, dropped: 0, current: 10.21, average: 10.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 46, dropped: 0, current: 9.94, average: 10.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 46, dropped: 0, current: 9.94, average: 10.38
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 52, dropped: 0, current: 9.92, average: 10.33
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 52, dropped: 0, current: 9.92, average: 10.33
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 58, dropped: 0, current: 9.89, average: 10.28
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 58, dropped: 0, current: 9.89, average: 10.28
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 64, dropped: 0, current: 10.23, average: 10.28

    as u can see, its fps was 10.And it palyed more slow than what I captured.

    And I have met the same fps problem when using your YAVTA demo which have not solved.
    You can get the specific information from this website:e2e.ti.com/.../650759 which I put forward ever.
    So could tried the same pipeline on your side and give me some advice to solve the encode problem, Yavta demo problem.
    Thanks&regards!
  • Hello,

    What is your video source and what is the resolution and fps that it provides?
    What you are using EVM or custom board?
    I would recommend you first to verify the capture with yavta instead of gstreamer.
    Please check this guide and yavta usage:
    processors.wiki.ti.com/.../Linux_Core_VIP_User's_Guide
    You could try:
    yavta -c30 -fYUYV -F/dev/null -s1280x720 /dev/video1
    In this example there will be no file write.

    BR
    Margarita
  • Hello,
    I'm used EVM with ov10635,its datasheet website:html.alldatasheet.com/.../OV10635.html
    The resolution is 1280x720,fps is 30.U can check the website I give u.
    And I have put forward the problem here: e2e.ti.com/.../650759
    But u have not give me any useful solutions to solve the framerate setting problem.
    I tested the YAVTA demo:
    yavta -c30 -fYUYV -F/dev/video1 -s1280x720 /dev/video1 -t1/25
    However , it set the framerate unsuccessfully:
    Device /dev/video1 opened.
    Device `vip' on `platform:vip' is a video output (without mplanes) device.
    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Current frame rate: 1/30
    Setting frame rate to: 1/25
    Frame rate set: 1/30
    8 buffers requested.
    length: 1843200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xb6cbd000.
    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6afb000.
    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6939000.
    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb6777000.
    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb65b5000.
    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb63f3000.
    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6231000.
    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb606f000.
    0 (0) [-] top 0 1843200 B 9380.262571 9380.262600 18.804 fps ts mono/EoF
    write error: Invalid argument (22)
    1 (1) [-] top 1 1843200 B 9380.295903 9380.295925 30.001 fps ts mono/EoF
    write error: Invalid argument (22)
    2 (2) [-] top 2 1843200 B 9380.329238 9380.329259 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    3 (3) [-] top 3 1843200 B 9380.362571 9380.362596 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    4 (4) [-] top 4 1843200 B 9380.395905 9380.395926 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    5 (5) [-] top 5 1843200 B 9380.429239 9380.429260 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    6 (6) [-] top 6 1843200 B 9380.462573 9380.462597 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    7 (7) [-] top 7 1843200 B 9380.495906 9380.495927 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    8 (0) [-] top 8 1843200 B 9380.529240 9380.529261 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    9 (1) [-] top 9 1843200 B 9380.562573 9380.562597 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    10 (2) [-] top 10 1843200 B 9380.595907 9380.595928 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    11 (3) [-] top 11 1843200 B 9380.629241 9380.629261 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    12 (4) [-] top 12 1843200 B 9380.662575 9380.662600 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    13 (5) [-] top 13 1843200 B 9380.695908 9380.695929 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    14 (6) [-] top 14 1843200 B 9380.729242 9380.729263 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    15 (7) [-] top 15 1843200 B 9380.762576 9380.762600 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    16 (0) [-] top 16 1843200 B 9380.795910 9380.795931 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    17 (1) [-] top 17 1843200 B 9380.829243 9380.829264 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    18 (2) [-] top 18 1843200 B 9380.862577 9380.862601 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    19 (3) [-] top 19 1843200 B 9380.895911 9380.895933 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    20 (4) [-] top 20 1843200 B 9380.929245 9380.929266 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    21 (5) [-] top 21 1843200 B 9380.962578 9380.962602 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    22 (6) [-] top 22 1843200 B 9380.995912 9380.995933 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    23 (7) [-] top 23 1843200 B 9381.029245 9381.029267 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    24 (0) [-] top 24 1843200 B 9381.062579 9381.062603 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    25 (1) [-] top 25 1843200 B 9381.095913 9381.095934 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    26 (2) [-] top 26 1843200 B 9381.129247 9381.129268 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    27 (3) [-] top 27 1843200 B 9381.162581 9381.162604 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    28 (4) [-] top 28 1843200 B 9381.195914 9381.195935 30.000 fps ts mono/EoF
    write error: Invalid argument (22)
    29 (5) [-] top 29 1843200 B 9381.229248 9381.229269 29.999 fps ts mono/EoF
    write error: Invalid argument (22)
    Captured 30 frames in 1.019879 seconds (29.415231 fps, 54218152.933174 B/s).
    8 buffers released.

    So have u ever met this problem?Could u tried the same codeon your side and give me some advice.
    Thanks&regards!
  • Hello,
    I tested the command:yavta -c1 -fYUYV -F0130_1.yuv -s1280x720 /dev/video1 -t1/25

    output:
    Device /dev/video1 opened.
    Device `vip' on `platform:vip' is a video output (without mplanes) device.
    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Current frame rate: 1/30
    Setting frame rate to: 1/25
    Frame rate set: 1/30
    8 buffers requested.
    length: 1843200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xb6c15000.
    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6a53000.
    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6891000.
    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb66cf000.
    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb650d000.
    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb634b000.
    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6189000.
    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb5fc7000.
    0 (0) [-] top 0 1843200 B 9874.952959 9874.952988 18.907 fps ts mono/EoF
    Captured 1 frames in 0.052920 seconds (18.896382 fps, 34829810.871406 B/s).
    8 buffers released.
  • Hello,

    Here is the results on my side:

    root@am57xx-evm:~# yavta -c60 -fYUYV -F/dev/null -s1280x720 /dev/video1

    Device /dev/video1 opened.

    Device `vip' on `platform:vip' is a video output (without mplanes) device.

    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200

    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200

    8 buffers requested.

    length: 1843200 offset: 0 timestamp type/source: mono/EoF

    Buffer 0/0 mapped at address 0xb6cdb000.

    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF

    Buffer 1/0 mapped at address 0xb6b19000.

    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF

    Buffer 2/0 mapped at address 0xb6957000.

    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF

    Buffer 3/0 mapped at address 0xb6795000.

    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF

    Buffer 4/0 mapped at address 0xb65d3000.

    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF

    Buffer 5/0 mapped at address 0xb6411000.

    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF

    Buffer 6/0 mapped at address 0xb624f000.

    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF

    Buffer 7/0 mapped at address 0xb608d000.

    0 (0) [-] top 0 1843200 B 136.863493 136.863522 18.792 fps ts mono/EoF

    1 (1) [-] top 1 1843200 B 136.896823 136.896845 30.003 fps ts mono/EoF

    2 (2) [-] top 2 1843200 B 136.930157 136.930178 29.999 fps ts mono/EoF

    3 (3) [-] top 3 1843200 B 136.963490 136.963511 30.000 fps ts mono/EoF

    4 (4) [-] top 4 1843200 B 136.996824 136.996846 29.999 fps ts mono/EoF

    5 (5) [-] top 5 1843200 B 137.030158 137.037616 29.999 fps ts mono/EoF

    6 (6) [-] top 6 1843200 B 137.063490 137.063513 30.001 fps ts mono/EoF

    7 (7) [-] top 7 1843200 B 137.096824 137.096845 29.999 fps ts mono/EoF

    8 (0) [-] top 8 1843200 B 137.130157 137.130178 30.000 fps ts mono/EoF

    9 (1) [-] top 9 1843200 B 137.163490 137.163512 30.000 fps ts mono/EoF

    10 (2) [-] top 10 1843200 B 137.196824 137.196846 29.999 fps ts mono/EoF

    11 (3) [-] top 11 1843200 B 137.230157 137.230178 30.000 fps ts mono/EoF

    12 (4) [-] top 12 1843200 B 137.263490 137.263511 30.000 fps ts mono/EoF

    13 (5) [-] top 13 1843200 B 137.296824 137.296847 29.999 fps ts mono/EoF

    14 (6) [-] top 14 1843200 B 137.330157 137.330180 30.000 fps ts mono/EoF

    15 (7) [-] top 15 1843200 B 137.363490 137.363511 30.000 fps ts mono/EoF

    16 (0) [-] top 16 1843200 B 137.396824 137.396845 29.999 fps ts mono/EoF

    17 (1) [-] top 17 1843200 B 137.430157 137.430179 30.000 fps ts mono/EoF

    18 (2) [-] top 18 1843200 B 137.463492 137.463518 29.999 fps ts mono/EoF

    19 (3) [-] top 19 1843200 B 137.496824 137.496846 30.001 fps ts mono/EoF

    20 (4) [-] top 20 1843200 B 137.530157 137.530178 30.000 fps ts mono/EoF

    21 (5) [-] top 21 1843200 B 137.563490 137.563511 30.000 fps ts mono/EoF

    22 (6) [-] top 22 1843200 B 137.596824 137.596845 29.999 fps ts mono/EoF

    23 (7) [-] top 23 1843200 B 137.630157 137.630181 30.000 fps ts mono/EoF

    24 (0) [-] top 24 1843200 B 137.663490 137.663512 30.000 fps ts mono/EoF

    25 (1) [-] top 25 1843200 B 137.696823 137.696845 30.000 fps ts mono/EoF

    26 (2) [-] top 26 1843200 B 137.730157 137.730178 29.999 fps ts mono/EoF

    27 (3) [-] top 27 1843200 B 137.763490 137.763512 30.000 fps ts mono/EoF

    28 (4) [-] top 28 1843200 B 137.796823 137.796845 30.000 fps ts mono/EoF

    29 (5) [-] top 29 1843200 B 137.830157 137.830178 29.999 fps ts mono/EoF

    30 (6) [-] top 30 1843200 B 137.863490 137.863512 30.000 fps ts mono/EoF

    31 (7) [-] top 31 1843200 B 137.896823 137.896845 30.000 fps ts mono/EoF

    32 (0) [-] top 32 1843200 B 137.930157 137.930177 29.999 fps ts mono/EoF

    33 (1) [-] top 33 1843200 B 137.963490 137.963511 30.000 fps ts mono/EoF

    34 (2) [-] top 34 1843200 B 137.996823 137.996845 30.000 fps ts mono/EoF

    35 (3) [-] top 35 1843200 B 138.030157 138.030178 29.999 fps ts mono/EoF

    36 (4) [-] top 36 1843200 B 138.063490 138.063512 30.000 fps ts mono/EoF

    37 (5) [-] top 37 1843200 B 138.096824 138.096845 29.999 fps ts mono/EoF

    38 (6) [-] top 38 1843200 B 138.130157 138.130178 30.000 fps ts mono/EoF

    39 (7) [-] top 39 1843200 B 138.163490 138.163511 30.000 fps ts mono/EoF

    40 (0) [-] top 40 1843200 B 138.196823 138.196845 30.000 fps ts mono/EoF

    41 (1) [-] top 41 1843200 B 138.230157 138.230178 29.999 fps ts mono/EoF

    42 (2) [-] top 42 1843200 B 138.263490 138.263512 30.000 fps ts mono/EoF

    43 (3) [-] top 43 1843200 B 138.296824 138.296845 29.999 fps ts mono/EoF

    44 (4) [-] top 44 1843200 B 138.330158 138.330178 29.999 fps ts mono/EoF

    45 (5) [-] top 45 1843200 B 138.363491 138.363512 30.000 fps ts mono/EoF

    46 (6) [-] top 46 1843200 B 138.396824 138.396846 30.000 fps ts mono/EoF

    47 (7) [-] top 47 1843200 B 138.430157 138.430179 30.000 fps ts mono/EoF

    48 (0) [-] top 48 1843200 B 138.463491 138.463512 29.999 fps ts mono/EoF

    49 (1) [-] top 49 1843200 B 138.496824 138.496845 30.000 fps ts mono/EoF

    50 (2) [-] top 50 1843200 B 138.530158 138.530179 29.999 fps ts mono/EoF

    51 (3) [-] top 51 1843200 B 138.563491 138.563512 30.000 fps ts mono/EoF

    52 (4) [-] top 52 1843200 B 138.596824 138.596845 30.000 fps ts mono/EoF

    53 (5) [-] top 53 1843200 B 138.630158 138.630178 29.999 fps ts mono/EoF

    54 (6) [-] top 54 1843200 B 138.663491 138.663512 30.000 fps ts mono/EoF

    55 (7) [-] top 55 1843200 B 138.696824 138.696845 30.000 fps ts mono/EoF

    56 (0) [-] top 56 1843200 B 138.730157 138.730178 30.000 fps ts mono/EoF

    57 (1) [-] top 57 1843200 B 138.763491 138.763512 29.999 fps ts mono/EoF

    58 (2) [-] top 58 1843200 B 138.796824 138.796846 30.000 fps ts mono/EoF

    59 (3) [-] top 59 1843200 B 138.830158 138.830178 29.999 fps ts mono/EoF

    Captured 60 frames in 2.019899 seconds (29.704455 fps, 54751252.061729 B/s).

    8 buffers released.

    root@am57xx-evm:~#

    As you could see the fps is 30.

    Here is the result of capture pipeline:

     gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=60 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720' ! vpe num-input-buffers=8 ! queue ! fpsdisplaysink -v

    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 15, dropped: 7, fps: 29.23, drop rate: 13.64
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 31, dropped: 7, current: 29.67, average: 29.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 31, dropped: 7, current: 29.67, average: 29.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 47, dropped: 7, current: 30.19, average: 29.70
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 47, dropped: 7, current: 30.19, average: 29.70

    Here is the result of capture -> enc ->fpsdisplay:

     gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=60 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! tee name=t  ! vpe num-input-buffers=8  ! queue ! ducatih264enc  ! queue ! h264parse ! avimux ! filesink location=x.avi t. ! queue  ! vpe  !   queue ! fpsdisplaysink -v
    Setting pipeline to PAUSED ...
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 15, dropped: 11, fps: 29.91, drop rate: 21.93
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 15, dropped: 11, fps: 29.91, drop rate: 21.93
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 30, dropped: 11, current: 29.21, average: 29.55
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 30, dropped: 11, current: 29.21, average: 29.55
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 46, dropped: 11, current: 30.30, average: 29.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 46, dropped: 11, current: 30.30, average: 29.81
    Got EOS from element "pipeline0".
    Execution ended after 0:00:02.317785436
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am57xx-evm:~#

    BR

    Margarita

  • Hello,
    I have tested the pipeline
    Here is the result of capture -> enc ->fpsdisplay (10fps): Howvever, it showed that its fps was 30.
    /GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-msvideo
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstKMSSink:fps-display-video_sink-actual-sink-kms: sync = true
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 14, dropped: 3, fps: 27.02, drop rate: 5.79
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 14, dropped: 3, fps: 27.02, drop rate: 5.79
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 29, dropped: 3, current: 29.83, average: 28.40
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 29, dropped: 3, current: 29.83, average: 28.40
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 44, dropped: 3, current: 29.65, average: 28.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 44, dropped: 3, current: 29.65, average: 28.81
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 60, dropped: 3, current: 29.93, average: 29.10
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 60, dropped: 3, current: 29.93, average: 29.10
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 75, dropped: 3, current: 29.93, average: 29.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 75, dropped: 3, current: 29.93, average: 29.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 91, dropped: 3, current: 30.19, average: 29.42
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 91, dropped: 3, current: 30.19, average: 29.42
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 107, dropped: 3, current: 29.92, average: 29.50

    But I decode the encode file:
    gst-launch-1.0 filesrc location=x.avi ! avidemux ! queue ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! fpsdisplaysink -v

    output:
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 7, dropped: 0, current: 13.59, average: 13.59
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 7, dropped: 0, current: 13.59, average: 13.59
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 12, dropped: 0, current: 9.90, average: 11.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 12, dropped: 0, current: 9.90, average: 11.76
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 17, dropped: 0, current: 9.90, average: 11.15
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 0, current: 9.90, average: 11.15
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 22, dropped: 0, current: 9.73, average: 10.79
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 22, dropped: 0, current: 9.73, average: 10.79
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 28, dropped: 0, current: 10.18, average: 10.65
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 28, dropped: 0, current: 10.18, average: 10.65
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 34, dropped: 0, current: 9.93, average: 10.52
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 34, dropped: 0, current: 9.93, average: 10.52
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 40, dropped: 0, current: 9.95, average: 10.43
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 40, dropped: 0, current: 9.95, average: 10.43
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 46, dropped: 0, current: 10.17, average: 10.39
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 46, dropped: 0, current: 10.17, average: 10.39
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 52, dropped: 0, current: 9.94, average: 10.34
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 52, dropped: 0, current: 9.94, average: 10.34
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 58, dropped: 0, current: 9.91, average: 10.29
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 58, dropped: 0, current: 9.91, average: 10.29
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 64, dropped: 0, current: 9.94, average: 10.26
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 64, dropped: 0, current: 9.94, average: 10.26

    So the video played more slow than what I captured.

    And I tried the capture->encode pipeline(30fps) without fpsdisplay.It palyed faster.
    could u tried this pipeline and played the videoto confirm whether it played faster or not:
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc ! queue ! h264parse ! avimux ! filesink location=x.avi

    And the the capture->encode pipeline(10fps) without fpsdisplay.It palyed slowly.
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc ! queue ! h264parse ! avimux ! filesink location=x.avi

    Besides, the YAVTA demo has a problem.
    could u tried the command:yavta -c1 -fYUYV -F0130_1.yuv -s1280x720 /dev/video1 -t1/25
    The output on my side is :
    Device /dev/video1 opened.
    Device `vip' on `platform:vip' is a video output (without mplanes) device.
    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200

    Current frame rate: 1/30
    Setting frame rate to: 1/25
    Frame rate set: 1/30

    8 buffers requested.
    length: 1843200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xb6c15000.
    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6a53000.
    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6891000.
    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb66cf000.
    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb650d000.
    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb634b000.
    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6189000.
    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb5fc7000.
    0 (0) [-] top 0 1843200 B 9874.952959 9874.952988 18.907 fps ts mono/EoF
    Captured 1 frames in 0.052920 seconds (18.896382 fps, 34829810.871406 B/s).
    8 buffers released.

    As u can see,I want set its framerate to 25fps.and its output was
    Current frame rate: 1/30
    Setting frame rate to: 1/25
    Frame rate set: 1/30
    it means it didn't set the framerate successufully.
    could u tried it on your side and give me some advice to solve these problems?
    Thanks&regards!
  • Hello,
    Could u tell me how to specify the cma pool size in kernel bootargs as cma=64M.Or is there any documents which can help me to do it.
    And did u forget the question I asked last week?Could help me to solve the problemor give me some useful suggestions.
    Thanks&regards!
  • Hello,

    You could use element like videorate.
    This element can do framerate conversion by dropping or duplicating frames.
    Pipeline like this could be used:
    gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1' ! tee name=t ! vpe num-input-buffers=8 ! queue ! ducatih264enc ! queue ! h264parse ! avimux ! filesink location=x.avi t. ! queue ! vpe ! videorate ! video/x-raw,framerate=20/2 ! queue ! fpsdisplaysink -v

    Here is the output:
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 6, dropped: 7, fps: 11.55, drop rate: 13.47
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 11, dropped: 7, current: 9.39, average: 10.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 11, dropped: 7, current: 9.39, average: 10.46
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 16, dropped: 7, current: 9.93, average: 10.29
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 16, dropped: 7, current: 9.93, average: 10.29
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 21, dropped: 7, current: 9.93, average: 10.20
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 21, dropped: 7, current: 9.93, average: 10.20
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 26, dropped: 7, current: 9.90, average: 10.14
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 26, dropped: 7, current: 9.90, average: 10.14
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 32, dropped: 7, current: 10.24, average: 10.16
    /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 32, dropped: 7, current: 10.24, average: 10.16

    Regarding the cma value please refer uEnv.txt file.

    BR
    Margarita
  • Hello,

    I add this"cma=128M" in the uEnv.txt file.But it did not help and showed the same problem when encoding.

    When booting the evm I found 

  • Hello,

    I tried to change cma in uEnv file, I see this:
    [ 0.000000] cma: Reserved 128 MiB at 0x00000000f7c00000

    Here is my bootargs:
    root@am57xx-evm:~# cat /proc/cmdline
    console=ttyO2,115200n8 root=PARTUUID=000e27fb-02 rw cma=128MiB rootfstype=ext4 rootwait root=PARTUUID=000e27fb-02 rw rootfstype=ext4 rootwait
    root@am57xx-evm:~#


    BR
    Margarita
  • Hello,

    I add the same  bootargs "console=ttyO2,115200n8 root=PARTUUID=000e27fb-02 rw cma=128MiB rootfstype=ext4 rootwait root=PARTUUID=000e27fb-02 rw rootfstype=ext4 rootwait" to the uEnv.txt.Although Iuse the command:cat /proc/cmdline, and the output was same as yours.However, when running my own application it ended in the same problem.

    Here is my code:

    #include <stdio.h>
    #include <gst/gst.h>
    #include <time.h>
    #include <string.h>
    #include <stdlib.h>
    #include<glib.h> 
    #define FRAME_264  (1280*720)
    #include <sys/time.h> 
    /*
    ��·ͨ�������źſ�ʼͬʱ�ɼ����룬��������������룬���Բ�ͬ�ļ������� 
     
    */ 
    FILE *pFile[4];
    unsigned int *dataPtr = NULL;
    
    GstElement *pipeline[6];
    GstBus *bus[6];
    GstMessage *msg[6];
    
    GstElement *src, *video_queue, *video_convert, *q1, *video_enc, *parse, *q3, *mux, *video_sink;
    GstElement *tee, *pic_queue, *pic_convert, *q2, *pic_enc, *pic_sink;
    GstPad *tee_video_pad, *tee_picture_pad;
    GstPad *queue_video_pad, *queue_picture_pad;
    
    static int i=0;
    static void new_sample (GstElement *sink) { 	
    	GstSample *sample = NULL;
    	GstBuffer *buffer = NULL;
      /* Retrieve the buffer */
      	g_signal_emit_by_name (pic_sink, "pull-sample", &sample);
      	buffer = gst_sample_get_buffer (sample);
      	int size = gst_buffer_get_size (buffer);
      	
    	i++;
    	g_print("i:%d\n",i);
    	if (i>50)
    	{
    		i=0;
      		if (buffer) {
      			FILE *fp = NULL;
        			//fp = fopen("/opt/image/deviceid/tunnel_1/image.jpg","wb+");
        			fp = fopen("image.jpg","wb+");
        			gst_buffer_extract (buffer,0,dataPtr,size);
        			fwrite(dataPtr, sizeof(unsigned int), size, fp);
    			gst_buffer_unref (buffer);
    	 		fclose(fp); 
       			fp = NULL;
    			g_print("have buffer!");
    			//system("/opt/uploadoss/main image deviceid tunnel_1 image.jpg"); 
      		} 
    	}
    	else
    	{
    		gst_buffer_unref (buffer);
    	} 
    	//gst_sample_unref(sample);	
    	sample = NULL;
    	buffer = NULL;
    }
    
    static gboolean link_source_element_with_filter(GstElement *element1,
    	GstElement *element2, int width, int height, int framerate)
    
    {
    	/* CAPS to be link:
    	* 'video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, framerate=5/1'
    	* */
    
    	gboolean link_ok;
    	GstCaps *caps;
    
    	caps = gst_caps_new_simple("video/x-raw",
    		"format", G_TYPE_STRING, "YUY2",
    		"width", G_TYPE_INT, width,
    		"height", G_TYPE_INT, height,
    		"framerate", GST_TYPE_FRACTION, framerate, 1,
    		NULL);
    
    	link_ok = gst_element_link_filtered(element1, element2, caps);
    	gst_caps_unref(caps);
    
    	if (!link_ok) {
    		g_warning("Failed to link element1 and element2!(v4l2src->convert)");
    	}
    	return link_ok;
    
    }
    
    
    void link_to_multiplexer(
    	GstElement *tolink_element,
    	GstElement *mux)
    {
    	GstCaps *pad_caps = NULL;
    	GstPad *pad;
    	GstPad *tolink_pad;
    	GstPadLinkReturn ret;
    
    	tolink_pad = gst_element_get_static_pad(tolink_element, "src");
    	pad_caps = gst_pad_query_caps(tolink_pad, NULL);
    	pad = gst_element_get_compatible_pad(mux, tolink_pad, pad_caps);
    	gst_caps_unref(pad_caps);
    
    	ret = gst_pad_link(tolink_pad, pad);
    	if (ret==0)
    		g_print("aaa\n");
    	gst_object_unref(GST_OBJECT(pad));
    	g_print("A new pad %s was created and linked to %s\n", gst_pad_get_name(tolink_pad), gst_pad_get_name(pad));
    }
    
    
    /* Main function does atual processing */
    
    void record_start(int channel, char * filename)
    
    //gst-launch-1.0 -e videotestsrc ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! qtmux ! filesink location=x.mov
    {
    //	GstElement *src, *video_queue, *video_convert, *q1, *video_enc, *parse, *q3, *mux, *video_sink;
    //	GstElement *tee, *pic_queue, *pic_convert, *pic_enc, *pic_sink; 
      	
    	gst_init(NULL, NULL);
    
    	/* Create the empty pipeline */
    	pipeline[channel] = gst_pipeline_new("test-pipeline");
    
    	/* Create the elements */
    	src = gst_element_factory_make("v4l2src", "video_source");
    	g_object_set(G_OBJECT(src), "device", "/dev/video1", NULL);
    	g_object_set(G_OBJECT(src), "io-mode", 4, NULL);
    	g_object_set(G_OBJECT(src), "num-buffers", -1, NULL);
    	/*
    	src = gst_element_factory_make("videotestsrc", "video_source");
    	g_object_set(G_OBJECT(src), "num-buffers", -1, NULL);
            */
    	video_convert = gst_element_factory_make("vpe", "video_convert");
    	g_object_set(G_OBJECT(video_convert), "num-input-buffers", 8, NULL);
    	q1 = gst_element_factory_make("queue", "q1");
    	video_enc = gst_element_factory_make("ducatih264enc", "video_enc");
    	g_object_set(G_OBJECT(video_enc), "profile", 100, NULL);//10000��������⣿�� 
    	g_object_set(G_OBJECT(video_enc), "level", 41, NULL);//10000��������⣿�� 
    	g_object_set(G_OBJECT(video_enc), "bitrate", 10000, NULL);//10000��������⣿�� 
    	
    	parse = gst_element_factory_make("h264parse", "parser");
    	q3 = gst_element_factory_make("queue", "q3");
    	mux = gst_element_factory_make("avimux", "mux");
    	video_sink = gst_element_factory_make("filesink", "video_sink");
    	g_object_set(G_OBJECT(video_sink), "location", filename, NULL);
    	q2 = gst_element_factory_make("queue", "q2");
    	tee = gst_element_factory_make ("tee", "tee");
    	video_queue =gst_element_factory_make("queue","video_queue"); 
    	pic_queue = gst_element_factory_make("queue","pic_queue"); 
    	pic_convert = gst_element_factory_make("vpe", "pic_convert");
    	g_object_set(G_OBJECT(pic_convert), "num-input-buffers", 8, NULL);
    	
    	pic_enc = gst_element_factory_make("ducatijpegenc", "pic_enc");
    	//g_object_set (pic_enc, "intra-interval", 100, NULL);
    	pic_sink = gst_element_factory_make("appsink", "pic_sink");
    	g_object_set (pic_sink, "emit-signals", TRUE, NULL);
      	g_signal_connect (pic_sink, "new-sample", G_CALLBACK (new_sample), NULL); 
    	
    
    	gst_bin_add_many(GST_BIN(pipeline[channel]), src, tee, video_queue, video_convert, q1, video_enc, parse, q3, mux, video_sink, pic_queue, pic_convert, q2,pic_enc, pic_sink, NULL);
      	
    	tee_video_pad = gst_element_get_request_pad (tee, "src_%u");
      	g_print ("Obtained request pad %s for video branch.\n", gst_pad_get_name (tee_video_pad));
      	queue_video_pad = gst_element_get_static_pad (video_queue, "sink");
      	tee_picture_pad = gst_element_get_request_pad (tee, "src_%u");
      	g_print ("Obtained request pad %s for picture branch.\n", gst_pad_get_name (tee_picture_pad));
      	queue_picture_pad = gst_element_get_static_pad (pic_queue, "sink");
      	
      	if (gst_pad_link (tee_picture_pad, queue_picture_pad) != GST_PAD_LINK_OK ||
          gst_pad_link (tee_video_pad, queue_video_pad) != GST_PAD_LINK_OK) {
        g_printerr ("Tee could not be linked.\n");
        gst_object_unref (pipeline);
      	}
    	  
      	if (gst_element_link_many (src, tee, NULL) != TRUE)
      	{
    	  	g_printerr ("src and tee could not be linked.\n");
      	}
      	
      	link_source_element_with_filter(video_queue, video_convert, 1280, 720, 30);
      		if (gst_element_link_pads(video_convert, "src", q1, "sink") != TRUE)
    	{
    		g_print("1\n");
    	}
    	if (gst_element_link_pads(q1, "src", video_enc, "sink") != TRUE)
    	{
    		g_print("2\n");
    	}
    	if (gst_element_link_pads(video_enc, "src", parse, "sink") != TRUE)
    	{
    		g_print("3\n");
    	}
    	if (gst_element_link_pads(parse, "src", q3, "sink") != TRUE)
    	{
    		g_print("4\n");
    	}
    	link_to_multiplexer(q3, mux);
    	if (gst_element_link_pads(mux, "src", video_sink, "sink") != TRUE)
    	{
    		g_print("5\n");
    	}
      	
      	link_source_element_with_filter(pic_queue, pic_convert, 1280, 720, 30);
    	
    	if(gst_element_link_pads(pic_convert, "src", q2, "sink")!= TRUE)
    	{
    		g_print("6\n");
    	}
    	if(gst_element_link_pads(q2, "src", pic_enc, "sink")!= TRUE)
    	{
    		g_print("66\n");
    	}
    	if(gst_element_link_pads(pic_enc, "src", pic_sink, "sink")!= TRUE)
    	{
    		g_print("7\n");
    	}
      
    	gst_object_unref (queue_picture_pad);
      	gst_object_unref (queue_video_pad);
    	
    	gst_element_set_state(pipeline[channel], GST_STATE_PLAYING);	
    }
    
    void record_stop(int channel)
    {
    
     	gst_element_send_event(pipeline[channel],gst_event_new_eos()); 	
    	/* Wait until error or EOS */
    	bus[channel] = gst_element_get_bus(pipeline[channel]);
    	msg[channel] = gst_bus_timed_pop_filtered(bus[channel], GST_CLOCK_TIME_NONE , GST_MESSAGE_ERROR | GST_MESSAGE_EOS);//GST_CLOCK_TIME_NONE
    	
     	gst_element_release_request_pad (tee, tee_picture_pad);
      	gst_element_release_request_pad (tee, tee_video_pad);
      	gst_object_unref (tee_picture_pad);
      	gst_object_unref (tee_video_pad);
      
    	if (msg[channel] != NULL)
    	{
    		gst_message_unref(msg[channel]);
    	}
    
    
    	gst_object_unref(bus[channel]);
    	
    	gst_element_set_state(pipeline[channel], GST_STATE_PAUSED);
    	gst_element_set_state(pipeline[channel], GST_STATE_READY);
    	gst_element_set_state(pipeline[channel], GST_STATE_NULL);
    	gst_object_unref(pipeline[channel]);
    }
    
    void main()
    {
        dataPtr=(unsigned int*)malloc(sizeof(unsigned int) * FRAME_264);
        memset(dataPtr,0,FRAME_264);
        
    	record_start(0, "ch0.avi");
    	sleep(50);
    	record_stop(0);
    	free(dataPtr);
    	dataPtr = NULL;
    }

    it always ended in the problem if the app running for a while:

    ** (video_picture:1261): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (video_picture:1261): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (video_picture:1261): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (video_picture:1261): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (video_picture:1261): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    Could u give me some advice of my code?Or do u have any other solutions to solve the problem?

  • Hello,

    Please for this new gstreamer application issue open a new topic.
    I will close this one.

    BR
    Margarita