<span style=" font-size:10pt;font-family:sans-serif">Hi,</span>
<br><span style=" font-size:10pt;font-family:sans-serif">Mr.Nicolas.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">I'm Kamiya.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">I resolved the
problem with the following code.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">The changing point
is return type. I changed GStrv* to GStrv. </span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">--------------------------------------------------</span>
<br><span style=" font-size:10pt;font-family:sans-serif">static GStrv formatLocationHandler(GstElement
*src, </span><tt><span style=" font-size:10pt">gpointer udata</span></tt><span style=" font-size:10pt;font-family:sans-serif">)</span>
<br><span style=" font-size:10pt;font-family:sans-serif">{</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> GStrv
locations = (GStrv)g_new0(gchar*, 4);</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"> locations[0]
= g_strdup("C:/Rec/2023/07/26/1808_28911.mp4");</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> locations[1]
= g_strdup("C:/Rec/2023/07/26/1808_38919.mp4");</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> locations[2]
= g_strdup("C:/Rec/2023/07/26/1808_47902.mp4");</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> locations[3]
= nullptr;</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"> return
locations;</span>
<br><span style=" font-size:10pt;font-family:sans-serif">}</span>
<br><span style=" font-size:10pt;font-family:sans-serif">--------------------------------------------------</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Is this a
correct way?</span>
<br><span style=" font-size:10pt;font-family:sans-serif">If it is correct
way, the following document and the gst-inspect of splitmuxsrc seems incorrect.</span>
<br><a href=https://gstreamer.freedesktop.org/documentation/multifile/splitmuxsrc.html><span style=" font-size:10pt;color:blue;font-family:sans-serif">https://gstreamer.freedesktop.org/documentation/multifile/splitmuxsrc.html</span></a>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Best regards,</span>
<br><span style=" font-size:10pt;font-family:sans-serif">Kamiya.</span>
<br>
<br>
<br><tt><span style=" font-size:10pt">SHIGEHARU KAMIYA/TOA wrote on 2023/08/08
10:32:52:</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> Hi,</span></tt>
<br><tt><span style=" font-size:10pt">> Mr.Nicolas.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> I'm Kamiya.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> Thank your for your advice.</span></tt>
<br><tt><span style=" font-size:10pt">> I changed to "GStrv *ret
= (GStrv*)g_new0(GStrv, 4);" like below <br>
> and no longer crashes.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> -------------------------------------------</span></tt>
<br><tt><span style=" font-size:10pt">> static GStrv* formatLocationHandler(GstElement
*splitmux, gpointer udata)</span></tt>
<br><tt><span style=" font-size:10pt">> {</span></tt>
<br><tt><span style=" font-size:10pt">> gchar **locations
= (gchar**)g_new0(gchar*, 4);</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> locations[0] = g_strdup("C:/Rec/2023/07/26/1808_28911.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> locations[1] =
g_strdup("C:/Rec/2023/07/26/1808_38919.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> locations[2] =
g_strdup("C:/Rec/2023/07/26/1808_47902.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> locations[3] =
nullptr;</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> GStrv *ret = (GStrv*)g_new0(GStrv, 4);</span></tt>
<br><tt><span style=" font-size:10pt">> std::memcpy(ret,
&locations, sizeof(locations));</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> return ret;</span></tt>
<br><tt><span style=" font-size:10pt">> }</span></tt>
<br><tt><span style=" font-size:10pt">> -------------------------------------------</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> However, splitmuxsrc output the below error.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> 0:00:01.696729000 69832 000001B40D38E600 DEBUG
<br>
> splitmuxsrc gstsplitmuxsrc.c:<br>
> 880:gst_splitmux_src_prepare_next_part:<splitmuxsrc0> Preparing
file<br>
> part nエ (0)</span></tt>
<br><tt><span style=" font-size:10pt">> 0:00:01.697042000 69832 000001B40D38E600
ERROR <br>
> splitmuxpartreader gstsplitmuxpartreader.c:<br>
> 1410:bus_handler:<splitmuxpartreader0> Got error message from
child <br>
> <filesrc0> marking this reader as failed</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> "Preparing file part nエ (0)" in the log should be "Preparing
file <br>
> part C:/Rec/2023/07/26/1808_28911.mp4 (0)".</span></tt>
<br><tt><span style=" font-size:10pt">> It seems that it's still not
referenced correctly.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> I also tried below code, but the result was the same.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> -------------------------------------------</span></tt>
<br><tt><span style=" font-size:10pt">> static GStrv* formatLocationHandler(GstElement
*src, FileLoader *obj)</span></tt>
<br><tt><span style=" font-size:10pt">> {</span></tt>
<br><tt><span style=" font-size:10pt">> GStrv *locations
= (GStrv*)g_new0(GStrv, 4);</span></tt>
<br><tt><span style=" font-size:10pt">> *locations = (gchar**)g_new0(gchar*,
4);</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> (*locations)[0] = g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/<br>
> 1808_28911.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> (*locations)[1]
= g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/<br>
> 1808_38919.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> (*locations)[2]
= g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/<br>
> 1808_47902.mp4");</span></tt>
<br><tt><span style=" font-size:10pt">> (*locations)[3]
= nullptr;</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> return locations;</span></tt>
<br><tt><span style=" font-size:10pt">> }</span></tt>
<br><tt><span style=" font-size:10pt">> -------------------------------------------</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> I'm embarrassed for not understanding pointers correctly.</span></tt>
<br><tt><span style=" font-size:10pt">> Could you give me some advice
or example code once more?</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> Best regards,</span></tt>
<br><tt><span style=" font-size:10pt">> Kamiya.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> "Nicolas Dufresne" <nicolas@ndufresne.ca> wrote on
2023/08/08 03:35:25:<br>
> > Le lundi 07 août 2023 à 20:07 +0900, geysee via gstreamer-devel
a écrit :<br>
> > > Hi,<br>
> > ><br>
> > > Mr. Nicolas.<br>
> > ><br>
> > ><br>
> > > I'm Kamiya.<br>
> > ><br>
> > ><br>
> > > I'm trying to combine multiple files with the splitmuxsrc
signal<br>
> > > "format_location" you advised.<br>
> > ><br>
> > > I haven't tried concat element yet. I thought that splitmuxsrc
<br>
> would be more<br>
> > > suitable because of the large number of files.<br>
> > ><br>
> > ><br>
> > > It succeeded when the return value of GStrv* type was initialized
as an<br>
> > > array.(code below)<br>
> > ><br>
> > ><br>
> > > -----------------------------<br>
> > ><br>
> > > static GStrv* formatLocationHandler(GstElement *splitmux,
gpointer udata)<br>
> > ><br>
> > > {<br>
> > ><br>
> > > gchar *locations[4];<br>
> > ><br>
> > ><br>
> > > locations[0] = g_strdup("C:/Rec/2023/07/26/1808_28911.mp4");<br>
> > ><br>
> > > locations[1] = g_strdup("C:/Rec/2023/07/26/1808_38919.mp4");<br>
> > ><br>
> > > locations[2] = g_strdup("C:/Rec/2023/07/26/1808_47902.mp4");<br>
> > ><br>
> > > locations[3] = nullptr;<br>
> > ><br>
> > ><br>
> > > GStrv *ret = (GStrv*)g_new0(GStrv, 1);<br>
> > ><br>
> > > std::memcpy(ret, &locations, sizeof(locations));<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > You have 1 pointer allocated,
but memcopy 4, this is going to overflow.<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > ><br>
> > ><br>
> > ><br>
> > > return ret;<br>
> > ><br>
> > > }<br>
> > ><br>
> > > -----------------------------<br>
> > ><br>
> > ><br>
> > > On the other hand, if the return value was dynamically <br>
> allocated, it will be<br>
> > > crashed after exiting formatLocationHandler.(code below)<br>
> > ><br>
> > ><br>
> > > -----------------------------<br>
> > ><br>
> > > static GStrv* formatLocationHandler(GstElement *splitmux,
gpointer udata)<br>
> > ><br>
> > > {<br>
> > ><br>
> > > gchar **locations = (gchar**)g_new0(gchar*,
4);<br>
> > ><br>
> > ><br>
> > > locations[0] = g_strdup("C:/Rec/2023/07/26/1808_28911.mp4");<br>
> > ><br>
> > > locations[1] = g_strdup("C:/Rec/2023/07/26/1808_38919.mp4");<br>
> > ><br>
> > > locations[2] = g_strdup("C:/Rec/2023/07/26/1808_47902.mp4");<br>
> > ><br>
> > > locations[3] = nullptr;<br>
> > ><br>
> > ><br>
> > > GStrv *ret = (GStrv*)g_new0(GStrv, 1);<br>
> > ><br>
> > > std::memcpy(ret, &locations, sizeof(locations));<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > Same bug, it just worked
by accident previously.<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > ><br>
> > ><br>
> > ><br>
> > > return ret;<br>
> > ><br>
> > > }<br>
> > ><br>
> > > -----------------------------<br>
> > ><br>
> > ><br>
> > > Could you tell me how to dynamically allocate the file list
in<br>
> > > formatLocationHandler ?<br>
> > ><br>
> > > I am very embarrassed that it may be a basic problem with
C <br>
> > language or GLib,<br>
> > > but I have been unable to solve it for a long time, so I
would <br>
> > appreciate your<br>
> > > help.<br>
> > ><br>
> > ><br>
> > > Best regards,<br>
> > ><br>
> > > Kamiya.<br>
> > ><br>
> > ><br>
> > ><br>
> > > SHIGEHARU KAMIYA/TOA wrote on 2023/08/03 12:04:11:<br>
> > ><br>
> > > ><br>
> > > > Hi,<br>
> > ><br>
> > > > Mr. Nicolas.<br>
> > ><br>
> > > ><br>
> > > > Thank you for your reply.<br>
> > ><br>
> > > > Your way looks nice!<br>
> > ><br>
> > > ><br>
> > > > I am trying it now.<br>
> > ><br>
> > > > I will let you know the results later.<br>
> > ><br>
> > > ><br>
> > > > Thank you.<br>
> > ><br>
> > > > Kamiya.<br>
> > ><br>
> > > ><br>
> > > > "gstreamer-devel" <gstreamer-devel-bounces@lists.freedesktop.org><br>
> > > > wrote on 2023/08/03 07:09:52:<br>
> > ><br>
> > > > ><br>
> > > > > Hi,<br>
> > ><br>
> > > > > Le mar. 1 août 2023, 03 h 15, geysee via gstreamer-devel
<<br>
> > > > > gstreamer-devel@lists.freedesktop.org> a écrit
:<br>
> > ><br>
> > > > > > Hello<br>
> > > > > > I am Kamiya.<br>
> > > > > ><br>
> > > > > > I have a question.<br>
> > > > > ><br>
> > > > > > Is it a good way to separate pipelines in
order to <br>
> dynamically change<br>
> > > > > > properties<br>
> > > > > > that cannot be changed in the PLAYING state,
such as the location<br>
> > > property<br>
> > > > > > in filesrc?<br>
> > ><br>
> > > > ><br>
> > > > > It can be a good method. But from what you described
below, <br>
> you may get<br>
> > > > > easier results with concat element instead. splitmuxsrc
should<br>
> > work, there<br>
> > > > > is a signal to query the filename from your app
instead of <br>
> > using the glob.<br>
> > ><br>
> > > > ><br>
> > > > > ><br>
> > > > > > I'm sorry for the long post, but the background
of the <br>
> question is as<br>
> > > > > > follows.<br>
> > > > > ><br>
> > > > > ><br>
> > > > > ><br>
> > > > ><br>
> > > > <br>
> > ----------------------------------------------------------------------------<br>
> > > -----------------------------------------------------<br>
> > > > > > I'm making a system that records video from
a network camera while<br>
> > > > > > dividing it into files.<br>
> > > > > > If the file is split at 10 minute intervals,
the file pathwill be as<br>
> > > > > > follows.<br>
> > > > > ><br>
> > > > > > C:/Rec/2023/07/31/1330_00000.mp4<br>
> > > > > > C:/Rec/2023/07/31/1340_00000.mp4<br>
> > > > > > C:/Rec/2023/07/31/1350_00000.mp4<br>
> > > > > ><br>
> > > > > > With gstreamer C++ coding, I am trying to
export as a single file by<br>
> > > > > > specifying the date and time range from the
divided recording files.<br>
> > > > > ><br>
> > > > > > If the date and time range is in one file,
like 13:32 - 13:<br>
> > 34, then the<br>
> > > > > > pipeline below has been successful. (Properties
are omitted)<br>
> > > > > ><br>
> > > > > > pileline : filesrc ! qtdemux ! h265parse
! queue ! qtmux ! filesink<br>
> > > > > ><br>
> > > > > > On the other hand, if the date and time range
is split into multiple<br>
> > > > > > files, like 7/31 20:00 - 8/1 10:00, this
pipeline fails.<br>
> > > > > ><br>
> > > > > > First, I tried multifilesrc and splitmuxsrc,
but the <br>
> location property<br>
> > > is<br>
> > > > > > a glob pattern, it didn't fit the file path
of date and time.<br>
> > > > > > Next, I tried updating the location property
of filesrc <br>
> sequentially,<br>
> > > but<br>
> > > > > > I couldn't change the location when this
state is PLAYING.<br>
> > > > > ><br>
> > > > > > So now I'm trying to divide the pipeline
into two as follows.<br>
> > > > > ><br>
> > > > > > pipeline1 : filesrc ! qtdemux ! h265parse
! appsink<br>
> > > > > > pipeline2 : appsrc ! queue ! qtmux ! filesink<br>
> > > > > ><br>
> > > > > > When pipeline1 reaches the end of stream,
I change the state of<br>
> > > pipeline1<br>
> > > > > > to Ready.<br>
> > > > > > Next I change the location of filesrc. Finaly
I change <br>
> stateto PLAYING<br>
> > > > > > again.<br>
> > > > > > The State of pipeline2 is not changed.<br>
> > > > > ><br>
> > > > > > However this way has not been successful
yet. There are <br>
> more problems<br>
> > > than<br>
> > > > > > single pipeline.<br>
> > > > > ><br>
> > > > > > Currently looking into the following issues:<br>
> > > > > > If there was single pipeline it was processed
at high <br>
> speed,but if the<br>
> > > > > > pipeline is divided, the processing time
will be as per <br>
> the timestamp.<br>
> > > > > ><br>
> > > > > > Is it a good way to split the pipeline like
this?<br>
> > > > > > I would appreciate if you give me some advice.<br>
> > > > > ><br>
> > > > > ><br>
> > > > ><br>
> > > > <br>
> > ----------------------------------------------------------------------------<br>
> > > -----------------------------------------------------<br>
> > > > > ><br>
> > > > > > Best regards,<br>
> > > > > > Kamiya.<br>
> > ><br>
</span></tt>