<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">Thank your for
your advice.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">I changed to "GStrv
*ret = (GStrv*)g_new0(GStrv, 4);" like below and no longer
crashes.</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 *splitmux, gpointer udata)</span>
<br><span style=" font-size:10pt;font-family:sans-serif">{</span>
<br><span style=" font-size:10pt;font-family:sans-serif">
gchar **locations = (gchar**)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">
GStrv *ret = (GStrv*)g_new0(GStrv, 4);</span>
<br><span style=" font-size:10pt;font-family:sans-serif">
std::memcpy(ret, &locations, sizeof(locations));</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">
return ret;</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">However, splitmuxsrc
output the below error.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">0:00:01.696729000
69832 000001B40D38E600 DEBUG
splitmuxsrc gstsplitmuxsrc.c:880:gst_splitmux_src_prepare_next_part:<splitmuxsrc0>
Preparing file part n$B%((B (0)</span>
<br><span style=" font-size:10pt;font-family:sans-serif">0:00:01.697042000
69832 000001B40D38E600 ERROR splitmuxpartreader gstsplitmuxpartreader.c:1410:bus_handler:<splitmuxpartreader0>
Got error message from child <filesrc0> marking this reader as failed</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">"Preparing
file part n$B%((B (0)" in the log should be "Preparing file part
C:/Rec/2023/07/26/1808_28911.mp4 (0)".</span>
<br><span style=" font-size:10pt;font-family:sans-serif">It seems that
it's still not referenced correctly.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">I also tried below
code, but the result was the same.</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, FileLoader *obj)</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(GStrv, 4);</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> *locations
= (gchar**)g_new0(gchar*, 4);</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif"> (*locations)[0]
= g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/1808_28911.mp4");</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> (*locations)[1]
= g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/1808_38919.mp4");</span>
<br><span style=" font-size:10pt;font-family:sans-serif"> (*locations)[2]
= g_strdup("C:/TOA/NR/Rec/2023/07/26/CH0001/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">I'm embarrassed
for not understanding pointers correctly.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">Could you give
me some advice or example code once more?</span>
<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">"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
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 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 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, 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 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 path will 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 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 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 stateto PLAYING<br>
> > > > > again.<br>
> > > > > The State of pipeline2 is not changed.<br>
> > > > ><br>
> > > > > However this way has not been successful yet.
There are 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 speed,but if the<br>
> > > > > pipeline is divided, the processing time will
be as per 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>
<br><tt><span style=" font-size:10pt">> [$BE:IU%U%!%$%k(B "C.htm"
$B$O(B $B?@C+(B $BLP<#(B/TOA $B$,:o=|$7$^$7$?(B] </span></tt>