Issue processing video with flvdemux

I am streaming a video using obs studio to a local rtmp url and i want to access to the streaming using gstreamer. I have no issues accessing the audio of the streaming, however i am not able to get the video of the stream. I am using flvdemux to get the audio and video streams. When i get use demux. and demux.audio I have no issues. Meanwhile when i use demux.video i get some errors.

This next commands work correctly:

GST_DEBUG=3 gst-launch-1.0 -v rtmpsrc location=rtmp://localhost/live/stream ! flvdemux name=demux demux. ! fakesink dump=true
GST_DEBUG=3 gst-launch-1.0 -v rtmpsrc location=rtmp://localhost/live/stream ! flvdemux name=demux demux.audio ! fakesink dump=true

This next command doesnt work:

GST_DEBUG=3 gst-launch-1.0 -v rtmpsrc location=rtmp://localhost/live/stream ! flvdemux name=demux demux.video ! fakesink dump=true

This is the error i get:

Can someone help me with the issue? Is the issue related to flvdemux? Is there an alternative to extract video stream from rtmp stream?

I would appreciate if someone could explain me what is causing the issue and how i can solve it.

What video codec is being used here?

It sounds like flvdemux might not recognise the video stream/codec.

You could check the GST_DEBUG=flv*:LOG debug log to see if it shows anything useful.

I have checked the GST_DEBUG=flv*:LOG but I dont see any issue in a first glance. In the next images you can see the output.


Do you see anything to which I can attach to solve the issue?

From your screenshots it looks like the codec should be H.264, which flvdemux should handle fine.

But it also looks like it errors out after pushing on the audio pad (which would be a substle bug in flvdemux too).

I’m guessing because of that it never proceeds to the video packet and create the video pad.

Could you try if this works:

gst-launch-1.0 -v rtmpsrc location=rtmp://localhost/live/stream ! flvdemux name=demux \
    demux.video ! queue ! fakesink dump=true \
    demux.audio ! queue ! fakesink

When I try the last approach that you have proposed the clock gets frozen and the command doesn’t capture the video and the audio. There is no error at first glance, but it seems that is not working correctly. I show below the output in the command line and the logs:



It seems that the first audio packacge is processed correctly, but there is an issue with the video processing and the second audio package is not processed by gstreamer.

Perhaps you could make the file, or at least the first 1MB of the file or so, available somewhere so we can try it ourselves?

Do you want the video file that I obtain from the rtmp stream?

I have tried with different set-ups, but I usually i have the rtmp server configured with nginx in ubuntu. And i create the rtmp streaming with obs studio. I am able to play the stream with different player (ffplay, vlc, etc.), but i demux the stream using flvdemux.

I can save the stream into a flv file and pass it to you. Is this what you are asking for?

Yes, that’s what I meant.