<div dir="ltr"><div>> It ends up doing<br>> emit positionUpdated( f_pos, i_time, i_length / CLOCK_FREQ );</div><div><br></div><div>Thank you Steve for pointing this out. Looking at the function that emits this I found the following line that returns the current time position. <br></div><div><br></div><div>**var_GetInteger(p_input , "time");** // This line retrieves the time at current position in microseconds</div><div><br></div><div> I called this in the **MainInterface::keyPressEvent(...)** callback to retrieve the current time which works !!!</div><div><br></div><div>Now I want to log this to a file at the same location as the current playing file. How to retrieve the file path and file name of the current playing file?<br></div><div><br></div><div>Thanks,</div><div>John<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 8, 2022 at 2:13 PM Steve Lhomme <<a href="mailto:robux4@ycbcr.xyz">robux4@ycbcr.xyz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2022-03-07 21:19, John Hammer wrote:<br>
> > You mean visually?<br>
> <br>
> Yes. Basically while watching the video pressing the key manually should <br>
> log timestamps to a file. There will be 2 keys one for start timestamp <br>
> and one for end timestamp. The goal is to log the timestamps of <br>
> interesting parts of the video for external processing.<br>
> <br>
> > There are time events reported by the core that you can hook into to <br>
> know where you are.<br>
> <br>
> I could modify the Qt GUI module and could listen to the key presses. <br>
> The following is the patch that works. Where is the time event hook? <br>
> Does this mean I have to store the keypress event for later processing <br>
> in the time hook event?<br>
<br>
In libvlc there are 2 events: libvlc_MediaPlayerPositionChanged and <br>
libvlc_MediaPlayerTimeChanged. But if you use VLC directly it's not much <br>
use. They correspond to INPUT_EVENT_POSITION in Qt (on 3.0).<br>
<br>
It ends up doing<br>
emit positionUpdated( f_pos, i_time, i_length / CLOCK_FREQ );<br>
<br>
<br>
<br>
> diff --git a/modules/gui/qt/main_interface.cpp <br>
> b/modules/gui/qt/main_interface.cpp<br>
> index a57506533d..cd1ebad916 100644<br>
> --- a/modules/gui/qt/main_interface.cpp<br>
> +++ b/modules/gui/qt/main_interface.cpp<br>
> @@ -28,7 +28,7 @@<br>
> #endif<br>
> <br>
> #include "qt.hpp"<br>
> -<br>
> +#include <QDebug><br>
> #include "main_interface.hpp"<br>
> #include "input_manager.hpp" // Creation<br>
> #include "actions_manager.hpp" // killInstance<br>
> @@ -72,6 +72,7 @@<br>
> <br>
> #include <QTimer><br>
> <br>
> +<br>
> #include <vlc_actions.h> /* Wheel event */<br>
> #include <vlc_vout_display.h> /* vout_thread_t and VOUT_ <br>
> events */<br>
> <br>
> @@ -1612,6 +1613,17 @@ void <br>
> MainInterface::dragLeaveEvent(QDragLeaveEvent *event)<br>
> ************************************************************************/<br>
> void MainInterface::keyPressEvent( QKeyEvent *e )<br>
> {<br>
> + switch (e->key()) {<br>
> + case Qt::Key_End:<br>
> + case Qt::Key_1:<br>
> + qDebug()<<e<<" start timestamp \n";<br>
> + break;<br>
> + case Qt::Key_PageDown:<br>
> + case Qt::Key_2:<br>
> + qDebug()<<e<<" end timestamp \n";<br>
> + break;<br>
> + }<br>
> +<br>
> handleKeyPress( e );<br>
> <br>
> Thanks,<br>
> John<br>
> <br>
> On Mon, Mar 7, 2022 at 2:02 PM Steve Lhomme <<a href="mailto:robux4@ycbcr.xyz" target="_blank">robux4@ycbcr.xyz</a> <br>
> <mailto:<a href="mailto:robux4@ycbcr.xyz" target="_blank">robux4@ycbcr.xyz</a>>> wrote:<br>
> <br>
> <br>
> <br>
> On 2022-03-05 19:01, John Hammer wrote:<br>
> > Hi,<br>
> > I want to retrieve the start and end timestamp of parts of<br>
> the video<br>
> > for post-processing with an external program. Since Lua extension<br>
> does<br>
> <br>
> You mean visually ? There are time events reported by the core that you<br>
> can hook into to know where you are.<br>
> <br>
> > not support keybindings, I have decided to modify the source code. I<br>
> > could compile the 3.x branch and debug the qt module interface.<br>
> It looks<br>
> > like this in the keypress event callbacks of this module is where<br>
> the<br>
> > code to log the timestamps should go.<br>
> ><br>
> > Am I on the right track on implementing this feature or is<br>
> there<br>
> > any other way?<br>
> ><br>
> > I also would like to color the areas on the time slider where<br>
> the<br>
> > start and end timestamps occurred. I have no idea how to achieve<br>
> this.<br>
> > Any suggestions on which module to be changed to achieve this?<br>
> <br>
> If you want to change the UI you have to modify the Qt gui module/<br>
> <br>
> > --<br>
> > Thanks,<br>
> > John<br>
> ><br>
> > _______________________________________________<br>
> > vlc-devel mailing list<br>
> > To unsubscribe or modify your subscription options:<br>
> > <a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
> <<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a>><br>
> _______________________________________________<br>
> vlc-devel mailing list<br>
> To unsubscribe or modify your subscription options:<br>
> <a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
> <<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a>><br>
> <br>
> <br>
> <br>
> -- <br>
> Regards<br>
> <br>
> _______________________________________________<br>
> vlc-devel mailing list<br>
> To unsubscribe or modify your subscription options:<br>
> <a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Regards<br></div></div>