<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'm trying to
combine multiple files with the splitmuxsrc signal "format_location"
you advised.</span>
<br><span style=" font-size:10pt;font-family:sans-serif">I haven't tried
concat element yet. I thought that splitmuxsrc would be more suitable because
of the large number of files.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">It succeeded when
the return value of GStrv* type was initialized as an array.(code below)</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[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, 1);</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">On the other hand,
if the return value was dynamically allocated, it will be crashed after
exiting formatLocationHandler.(code below)</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, 1);</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">Could you tell
me how to dynamically allocate the file list in formatLocationHandler ?</span>
<br><span style=" font-size:10pt;font-family:sans-serif">I am very embarrassed
that it may be a basic problem with C language or GLib, but I have been
unable to solve it for a long time, so I would appreciate your help.</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">SHIGEHARU KAMIYA/TOA wrote on 2023/08/03
12:04:11:</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>
> Thank you for your reply.</span></tt>
<br><tt><span style=" font-size:10pt">> Your way looks nice!</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> I am trying it now.</span></tt>
<br><tt><span style=" font-size:10pt">> I will let you know the results
later.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> Thank you.</span></tt>
<br><tt><span style=" font-size:10pt">> Kamiya.</span></tt>
<br><tt><span style=" font-size:10pt">> <br>
> "gstreamer-devel" <gstreamer-devel-bounces@lists.freedesktop.org>
<br>
> wrote on 2023/08/03 07:09:52:<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > <br>
> > Hi,<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > Le mar. 1 août 2023, 03
h 15, geysee via gstreamer-devel <<br>
> > gstreamer-devel@lists.freedesktop.org> a écrit :<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > > 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 property<br>
> > > in filesrc?<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > <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
work, there<br>
> > is a signal to query the filename from your app instead of using
the glob.<br>
</span></tt>
<br><tt><span style=" font-size:10pt">> > <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>
> > > 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: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 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, 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 pipeline1<br>
> > > to Ready.<br>
> > > Next I change the location of filesrc. Finaly I change state
to 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 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>
> > > Best regards,<br>
> > > Kamiya.</span></tt>
<br>