flvmux threading model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

flvmux threading model

Sean
This post was updated on .
Hi,

Here is my flvmux pipeline:

gst_launch flvmux name=mux ! filesink location=aac.flv audiotestsrc !  audioconvert ! audio/x-raw,channels=1 ! faac bitrate=64000 ! mux. videotestsrc  ! video/x-raw,framerate=25/1 ! x264enc ! mux.

I assume audio and video are two separate threads to mux the data into flv. When I checked the console log as below, I found both audio and video threads (thread ID: 0x7f495205f320, 0x7f495202b370) will execute the audio muxing path of gst_flv_mux_buffer_to_tag_internal() in interleaving way. While in the video muxing path (if (cpad->video) {....}) in gst_flv_mux_buffer_to_tag_internal(), the thread 0x7f495202b370 only executes video muxing path around 4 times (in the first 4 video muxing), later, all the video muxing path is executed by thread 0x7f495205f320. Would anyone help to comment my understanding? Thanks.

=============
audio muxing
=============
0:00:00.182170987 65681 0x7f495202b370 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.183994711 65681 0x7f495202b370 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.184712683 65681 0x7f495205f320 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.186367336 65681 0x7f495202b370 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.187036966 65681 0x7f495205f320 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.188928075 65681 0x7f495202b370 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1
0:00:00.189725651 65681 0x7f495205f320 DEBUG                 flvmux gstflvmux.c:1142:gst_flv_mux_buffer_to_tag_internal:<mux> Creating byte af with audio_codec:10, rate:3, width:1, channels:1