save stream VP8 to webm file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

save stream VP8 to webm file

ogurin

Hello, I have a question.

 

The task is to save VP8 from RTP packets into the webm file.

There are all RTP packets already saved into the file.

I am using pipeline like:

appsrc block=true do-timestamp=true format=3 is-live=true name=video_appsrc  "

                     "caps=\"application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)VP8-DRAFT-IETF-01\" ! "

                     "rtpvp8depay wait-for-keyframe=true ! webmmux name=mux ! filesink location=%s

 

I assume that I get an error when resolution of the video changes into the stream:

 

matroskamux matroska-mux.c:975:gst_matroska_mux_video_pad_setcaps:<mux> error: Caps changes are not supported by Matroska

0:00:00.371142012 26321       0xdcb8f0 INFO        GST_ERROR_SYSTEM gstelement.c:2224:gst_element_message_full_with_details:<mux> posting message: Could not multiplex stream.

0:00:00.371155378 26321       0xdcb8f0 INFO        GST_ERROR_SYSTEM gstelement.c:2251:gst_element_message_full_with_details:<mux> posted error message: Could not multiplex stream.

0:00:00.371169976 26321       0xdcb8f0 WARN             matroskamux matroska-mux.c:1356:gst_matroska_mux_video_pad_setcaps:<mux> pad video_0 refused caps video/x-vp8, framerate=(fraction)0/1, height=(int)180, width=(int)320, profile=(string)0

 

Please advise what I am doing wrong or maybe point me on error in pipeline

 

Thank you in advance

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: save stream VP8 to webm file

Trey Hutcheson
I experience this exact same problem - though in my case the video is coming via webrtcbin. It's been a defect on my backlog for a while now, but I'm just now getting around to dealing with it. I've got some code put together that works, but needs serious polish, but the sequence is: 

* add a probe (EVENT_DOWNSTREAM) on the webmmux video sink pad to filter for Caps events
* [if the pad has current caps] get the resolution from the current caps, and the new caps, and compare
* If they differ (they will - that's the point here):
** unlink webmmux from its upstream element
** remove webmmux and filesink elements from container (a bin in my case, not the root pipeline)
** set states of both elements to Null
** create new webmmux and filesink (to a new file) elements, link them, add them to parent container
** set states to Playing
* repeat (add probe, etc)

A few notes about this approach:
* I had hoped that calling query_accept_caps on the pad with the new caps would return false; but it doesn't. So I have to manually compare resolutions
* I had hoped that unlinking the video sink pad and requesting a new video sinking pad would work - effectively creating a new chapter in the target file. Unfortunately that was not supported either. 
* this approach creates N number of files for the source stream. My requirements allow this; yours may not.

On Tue, Jun 30, 2020 at 2:17 PM <[hidden email]> wrote:

Hello, I have a question.

 

The task is to save VP8 from RTP packets into the webm file.

There are all RTP packets already saved into the file.

I am using pipeline like:

appsrc block=true do-timestamp=true format=3 is-live=true name=video_appsrc  "

                     "caps=\"application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)VP8-DRAFT-IETF-01\" ! "

                     "rtpvp8depay wait-for-keyframe=true ! webmmux name=mux ! filesink location=%s

 

I assume that I get an error when resolution of the video changes into the stream:

 

matroskamux matroska-mux.c:975:gst_matroska_mux_video_pad_setcaps:<mux> error: Caps changes are not supported by Matroska

0:00:00.371142012 26321       0xdcb8f0 INFO        GST_ERROR_SYSTEM gstelement.c:2224:gst_element_message_full_with_details:<mux> posting message: Could not multiplex stream.

0:00:00.371155378 26321       0xdcb8f0 INFO        GST_ERROR_SYSTEM gstelement.c:2251:gst_element_message_full_with_details:<mux> posted error message: Could not multiplex stream.

0:00:00.371169976 26321       0xdcb8f0 WARN             matroskamux matroska-mux.c:1356:gst_matroska_mux_video_pad_setcaps:<mux> pad video_0 refused caps video/x-vp8, framerate=(fraction)0/1, height=(int)180, width=(int)320, profile=(string)0

 

Please advise what I am doing wrong or maybe point me on error in pipeline

 

Thank you in advance

 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel