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.

gstreamer TI plugin and DVBT mpeg2 stream problem

Hi

I need to play a DVBT stream (MPEG2) coming from an usb TV stick using gstreamer but I have problem. I'm currently using the following command line for my tests:

gst-launch udpsrc uri=udp://127.0.0.1:1234 ! mpegtsdemux name=demux  demux.video_0200 ! TIViddec2 genTimeStamps=false codecName=mpeg2dec engineName=codecServer ! TIDmaiVideoSink

The stream is "forwarder" through udp. The gstreamer show the video stream correctly but after some seconds the video start to show some noise that seem caused by an incorrect mpeg packets received. I tried to add the option "displayBuffer=true" for show the circular frame buffer status and I found the problem of this noise. Basically (as showed in the "report" of circular buffer generated by TI plugin following) there is a moment when the circular buffer is full (then the status written is "B" and not "W" or "R") and, my supposition, the TI plugin stop to get data in await of new space into the circular buffer. When a new space is available restart to insert new data into the buffer. This mechanism work without problems in case of read from a file since the read can be stopped in any time and started again from the same point. Unfortunately this doesn't work well for mpeg stream since in the moment the buffer engine stop to store data for buffer full all the next mpeg packes coming from the real time stream are lost and when start again to put packets into buffer there is an "hole" between the mpeg stream that cause the syncroniztion noises into the video.

Someone have an idea regarding how to fix this problem?

DOUBLE BUFFER REPORT

[R=====================|==========================W                           ]
[R=====================|===========================W                          ]
[R=====================|============================W                         ]
[ R=====================|===========================W                         ]
[ R=====================|============================W                        ]
[ R=====================|=============================W                       ]
[  R=====================|============================W                       ]
[   R=====================|===========================W                       ]
[   R=====================|============================W                      ]
[   R=====================|=============================W                     ]
[    R=====================|============================W                     ]
[    R=====================|=============================W                    ]
[     R=====================|============================W                    ]
[     R=====================|=============================W                   ]
[      R=====================|============================W                   ]
[       R=====================|===========================W                   ]
[       R=====================|============================W                  ]
[       R=====================|=============================W                 ]
[        R=====================|============================W                 ]
[        R=====================|=============================W                ]
[         R=====================|============================W                ]
[         R=====================|=============================W               ]
[          R=====================|============================W               ]
[          R=====================|=============================W              ]
[          R=====================|==============================W             ]
[           R=====================|=============================W             ]
[           R=====================|==============================W            ]
[            R=====================|=============================W            ]
[            R=====================|==============================W           ]
[             R=====================|=============================W           ]
[             R=====================|==============================W          ]
[              R=====================|=============================W          ]
[              R=====================|==============================W         ]
[               R=====================|=============================W         ]
[               R=====================|==============================W        ]
[                R=====================|=============================W        ]
[                 R=====================|============================W        ]
[                 R=====================|=============================W       ]
[                 R=====================|==============================W      ]
[                  R=====================|=============================W      ]
[                  R=====================|==============================W     ]
[                  R=====================|===============================W    ]
[                   R=====================|==============================W    ]
[                    R=====================|=============================W    ]
[                    R=====================|==============================W   ]
[                     R=====================|=============================W   ]
[                     R=====================|==============================W  ]
[                      R=====================|=============================W  ]
[                      R=====================|==============================W ]
[                       R=====================|=============================W ]
[                       R=====================|==============================W]
[                        R=====================|=============================W]
[                         R=====================|============================W]
[                          R=====================|===========================W]
[                           R=====================|==========================W]
[===========================B=====================|===========================]
[===========================WR=====================|==========================]
[============================B=====================|==========================]
[============================WR=====================|=========================]
[=============================B=====================|=========================]
[=============================WR=====================|========================]
[==============================B=====================|========================]
[==============================WR=====================|=======================]
[===============================B=====================|=======================]
[===============================WR=====================|======================]
[================================B=====================|======================]
[================================WR=====================|=====================]
[=================================B=====================|=====================]
[=================================WR=====================|====================]
[==================================B=====================|====================]
[==================================WR=====================|===================]
[===================================B=====================|===================]
[===================================WR=====================|==================]
[====================================B=====================|==================]
[====================================WR=====================|=================]
[=====================================B=====================|=================]
[=====================================WR=====================|================]
[======================================B=====================|================]
[======================================WR=====================|===============]
[=======================================B=====================|===============]
[=======================================WR=====================|==============]
[========================================B=====================|==============]
[========================================WR=====================|=============]
[=========================================B=====================|=============]
[=========================================WR=====================|============]
[==========================================B=====================|============]
[==========================================WR=====================|===========]
[==========================================W R=====================|==========]
[===========================================WR=====================|==========]
[============================================B=====================|==========]
[============================================WR=====================|=========]
[=============================================B=====================|=========]
[=============================================WR=====================|========]
[==============================================B=====================|========]
[==============================================WR=====================|=======]
[===============================================B=====================|=======]
[===============================================WR=====================|======]
[================================================B=====================|======]
[================================================WR=====================|=====]
[=================================================B=====================|=====]
[R=====================|==========================W                           ]
[R=====================|===========================W                          ]
[R=====================|============================W                         ]
[ R=====================|===========================W                         ]
[ R=====================|============================W                        ]
[  R=====================|===========================W                        ]
[  R=====================|============================W                       ]
[   R=====================|===========================W                       ]
[   R=====================|============================W                      ]
[    R=====================|===========================W                      ]
[    R=====================|============================W                     ]
[     R=====================|===========================W                     ]
[     R=====================|============================W                    ]
[     R=====================|=============================W                   ]
[      R=====================|============================W                   ]
[      R=====================|=============================W                  ]
[       R=====================|============================W                  ]
[        R=====================|===========================W                  ]
[        R=====================|============================W                 ]
[        R=====================|=============================W                ]
[         R=====================|============================W                ]
[         R=====================|=============================W               ]
[          R=====================|============================W               ]
[          R=====================|=============================W              ]
[           R=====================|============================W              ]
[           R=====================|=============================W             ]
[           R=====================|==============================W            ]
[            R=====================|=============================W            ]
[             R=====================|============================W            ]
[             R=====================|=============================W           ]
[              R=====================|============================W           ]
[              R=====================|=============================W          ]
[              R=====================|==============================W         ]
[               R=====================|=============================W         ]
[               R=====================|==============================W        ]
[                R=====================|=============================W        ]
[                R=====================|==============================W       ]
[                 R=====================|=============================W       ]
[                 R=====================|==============================W      ]
[                  R=====================|=============================W      ]
[                  R=====================|==============================W     ]
[                  R=====================|===============================W    ]
[                   R=====================|==============================W    ]
[                    R=====================|=============================W    ]
[                    R=====================|==============================W   ]
[                     R=====================|=============================W   ]
[                     R=====================|==============================W  ]
[                      R=====================|=============================W  ]
[                      R=====================|==============================W ]
[                       R=====================|=============================W ]
[                       R=====================|==============================W]
[                        R=====================|=============================W]
[                         R=====================|============================W]
[                          R=====================|===========================W]
[                           R=====================|==========================W]
[                            R=====================|=========================W]
[===========================WR=====================|==========================]
[============================B=====================|==========================]
[============================WR=====================|=========================]
[=============================B=====================|=========================]
[=============================WR=====================|========================]
[==============================B=====================|========================]
[==============================WR=====================|=======================]
[===============================B=====================|=======================]
[===============================WR=====================|======================]
[================================B=====================|======================]
[================================WR=====================|=====================]
[=================================B=====================|=====================]
[=================================WR=====================|====================]
[==================================B=====================|====================]
[==================================WR=====================|===================]
[===================================B=====================|===================]
[===================================WR=====================|==================]
[====================================B=====================|==================]
[====================================WR=====================|=================]
[=====================================B=====================|=================]
[=====================================WR=====================|================]
[======================================B=====================|================]
[======================================WR=====================|===============]
[=======================================B=====================|===============]
[=======================================WR=====================|==============]
[========================================B=====================|==============]
[========================================WR=====================|=============]
[=========================================B=====================|=============]
[=========================================WR=====================|============]
[==========================================B=====================|============]
[==========================================WR=====================|===========]
[===========================================B=====================|===========]

  • Just to provide additional info changing he command line as follow:

    gst-launch udpsrc uri=udp://127.0.0.1:1234 ! mpegtsdemux name=demux  demux.video_064a ! queue ! mpegvideoparse! TIViddec2 genTimeStamps=false codecName=mpeg2dec engineName=codecServer displayBuffer=true ! queue ! TIDmaiVideoSink

    I have the opposit probem. The circular buffer became empty very frequently and I can see continuous jerky in the video play. The double buffer graphic follow, the line with "------" mean the buffer is empty and is waiting for new data.

         R=====================W                                                 ]
    [     R=====================|W                                                ]
    [     R=====================|=W                                               ]
    [      R=====================|W                                               ]
    [      R=====================|==W                                             ]
    [       R=====================|=W                                             ]
    [       R=====================|==W                                            ]
    [        R=====================|=W                                            ]
    [         R=====================|W                                            ]
    [         R=====================|==W                                          ]
    [          R=====================|=W                                          ]
    [           R=====================|W                                          ]
    [           R=====================|=W                                         ]
    [            R=====================|W                                         ]
    [             R=====================W                                         ]
    [             R=====================|W                                        ]
    [             R=====================|=W                                       ]
    [              R=====================|W                                       ]
    [              R=====================|=W                                      ]
    [               R=====================|W                                      ]
    [               R=====================|=W                                     ]
    [                R=====================|W                                     ]
    [                 R=====================W                                     ]
    [                 R=====================|W                                    ]
    [                  R---------------------W                                    ]
    [                  R=====================|W                                   ]
    [                  R=====================|=W                                  ]
    [                  R=====================|==W                                 ]
    [                  R=====================|===W                                ]
    [                  R=====================|=====W                              ]
    [                  R=====================|======W                             ]
    [                   R=====================|=====W                             ]
    [                   R=====================|=======W                           ]
    [                     R=====================|=====W                           ]
    [                     R=====================|======W                          ]
    [                      R=====================|=====W                          ]
    [                      R=====================|======W                         ]
    [                        R=====================|====W                         ]
    [                         R=====================|===W                         ]
    [                         R=====================|====W                        ]
    [                         R=====================|=====W                       ]
    [                          R=====================|====W                       ]
    [                           R=====================|===W                       ]
    [                            R=====================|==W                       ]
    [                            R=====================|===W                      ]
    [                            R=====================|====W                     ]
    [                             R=====================|===W                     ]
    [                               R=====================|=W                     ]
    [                               R=====================|==W                    ]
    [                               R=====================|===W                   ]
    [                                R=====================|==W                   ]
    [                                  R=====================|W                   ]
    [                                  R=====================|=W                  ]
    [                                  R=====================|==W                 ]
    [                                   R=====================|=W                 ]
    [                                   R=====================|==W                ]
    [                                    R=====================|=W                ]
    [                                    R=====================|==W               ]
    [                                     R=====================|=W               ]
    [                                     R=====================|==W              ]
    [                                      R=====================|=W              ]
    [                                      R=====================|==W             ]
    [                                       R=====================|=W             ]
    [                                       R=====================|==W            ]
    [                                        R=====================|=W            ]
    [                                        R=====================|==W           ]
    [                                         R=====================|=W           ]
    [                                          R=====================|W           ]
    [                                           R---------------------W           ]
    [                                           R=====================|=W         ]
    [                                           R=====================|==W        ]
    [                                           R=====================|===W       ]
    [                                           R=====================|====W      ]
    [                                           R=====================|=====W     ]
    [                                            R=====================|====W     ]
    [                                              R=====================|==W     ]
    [                                              R=====================|====W   ]
    [                                               R=====================|===W   ]
    [                                                 R=====================|=W   ]
    [                                                 R=====================|==W  ]
    [                                                  R=====================|=W  ]
    [                                                  R=====================|===W]
    [                                                   R=====================|==W]
    [                                                    R=====================|=W]
    [===========================W                        R=====================|==]
    [===========================W                         R=====================|=]

  • I have an additional problem just discovered with audio. If I try the following line:

    gst-launch udpsrc uri=udp://127.0.0.1:1234 ! mpegtsdemux name=demux demux.audio_064c ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink

    I can hear the audio caming from the stream. But if I try to add the pipe for show the video also as:

    gst-launch udpsrc uri=udp://127.0.0.1:1234 ! mpegtsdemux name=demux demux.audio_064c ! queue max-size-buffers=1200 max-size-time=0 max-size-bytes=0 ! typefind ! mad ! alsasink demux.video_064a ! typefind ! queue ! mpegvideoparse ! TIViddec2 genTimeStamps=false codecName=mpeg2dec engineName=codecServer displayBuffer=true ! queue ! TIDmaiVideoSink

    I can see the video (with the problems described in the first post) but I can not hear any audio. I can hear some audio just for a moment at the beginning but it stop immediately.