Playback control file

Feature requests for VLC.
aJensen
New Cone
New Cone
Posts: 3
Joined: 21 Jul 2014 18:15

Playback control file

Postby aJensen » 15 Apr 2016 00:51

A nifty feature that I haven't seen in any media player would be the ability to control playback of a video/music/media file with a control file, perhaps something similar to a subtitle file. I would like to be able to create control files for some media such that the volume can be raised or lowered at various times and playback speed can fast-forward through various scenes and some time segments can be skipped.

Could this be done through the Lua interface? I see that volume control is possible but I don't see any playback speed control or jump to time functions. http://www.videolan.org/developers/vlc/ ... README.txt

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Playback control file

Postby mederi » 15 Apr 2016 17:09

The idea has been introduced in Subtitler (lite) mod, VLC Extension Lua script. The solution suggests to use various effect tags (commands) within ordinary subtitle format like SubRip srt. Current version of the extension requires to use a button presser, some external helper for periodic pressing of the button in the dialog box.

aJensen
New Cone
New Cone
Posts: 3
Joined: 21 Jul 2014 18:15

Re: Playback control file

Postby aJensen » 15 Apr 2016 18:23

The idea has been introduced in Subtitler (lite) mod, VLC Extension Lua script. The solution suggests to use various effect tags (commands) within ordinary subtitle format like SubRip srt. Current version of the extension requires to use a button presser, some external helper for periodic pressing of the button in the dialog box.
Nifty, thanks for the pointer! I've also found these related threads:
Mplayer has something similar - Edit Decision Lists (The edit decision list (EDL) system allows you to automatically skip or mute sections of videos during playback, based on a movie specific EDL configuration file). This looks like the most elegant solution so far except for the limited number of actions - "either 0 for skip or 1 for mute". If there were actions for setting the volume level (not only mute on/off) and setting the playback speed (not only skip) then this would be a nice solution.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Playback control file

Postby mederi » 15 Apr 2016 21:17

Skip, volume and playaback speed rate - all what you need is already available in VLC Lua:

Code: Select all

vlc.var.set(vlc.object.input(), "time", 10.0) vlc.volume.set(256) vlc.var.set(vlc.object.input(), "rate", 1.0)
Interesting idea utilising changes of playback speed: Time Saver

aJensen
New Cone
New Cone
Posts: 3
Joined: 21 Jul 2014 18:15

Re: Playback control file

Postby aJensen » 16 Apr 2016 22:30

Skip, volume and playaback speed rate - all what you need is already available in VLC Lua:

Code: Select all

vlc.var.set(vlc.object.input(), "time", 10.0) vlc.volume.set(256) vlc.var.set(vlc.object.input(), "rate", 1.0)
Wow, I would not have guessed that from: "Instructions to code your own VLC Lua scripts and extensions" (the only documentation on the Lua interface that I've been able to find). An example is *so* valuable. Thanks!
[...]Interesting idea utilising changes of playback speed: Time Saver
Ha! That's interesting. I might pillage his code for a few snippets and/or ideas.

tuberoseinrain
New Cone
New Cone
Posts: 7
Joined: 30 Dec 2019 04:18

Re: Playback control file

Postby tuberoseinrain » 30 Dec 2019 04:34

It is extremely easy to make skip(s) in the playback of a video (and possibly an audio) file in VLC. Follow these steps:

1. Open the video file in VLC.

2. Click on the “File” tab and the last option would be “Save Playlist”. Click on it. (This is how it looks on mac, and I assume it should be the same on Windows version of VLC as well. If not, you only need to find the “Save Playlist” option in one of the tabs.)

3. In the opened window, write an optional name and make sure the selected format is M3U (.m3u). Then save it exactly in the folder in which the video (or audio) file is located.

4. Then go to that folder and open the created m3u file with TextEdit on mac (or with Notepad on Windows).

5. If, for example, the name of your video file is “School.mkv”, then the text in the m3u file is something like the following text.
(For those who might not know, the “.mkv” in the mentioned name is not a part of the actual name and it is actually the format of the file in our example and it can be different for different types of files. So the name of the file in our example is “School”)



#EXTM3U
#EXTINF:617,School.mkv
School.mkv



6. In this step you need to add the following command to the above-mentioned text:

Let’s imagine the video file’s duration is 10:17 and you want VLC to skip from 2:47 to 4:51 during the playback. For this purpose, you first need to convert these times to seconds.

For converting times to seconds, you can use this free online tool:

https://www.tools4noobs.com/online_tools/hh_mm_ss_to_seconds/


So based on our example, you want VLC to play the video file from second 1 (0:01) until second 167 (2:47) and then from second 291 (4:51) until the end which is second 617 (10:17). So the code you should prepare will look like this:



#EXTVLCOPT:start-time=1
#EXTVLCOPT:stop-time=167
School.mkv
#EXTVLCOPT:start-time=291
#EXTVLCOPT:stop-time=617
School.mkv


7. Then you should add this command to the original text in the m3u file. The final result based on our example looks like the following code. Please note that you should delete the “School.mkv” which is mentioned in the third line of the original m3u file:


#EXTM3U
#EXTINF:617,School.mkv
#EXTVLCOPT:start-time=1
#EXTVLCOPT:stop-time=167
School.mkv
#EXTVLCOPT:start-time=291
#EXTVLCOPT:stop-time=617
School.mkv


8. Save the changes. Then instead of opening the video file, open the m3u file with VLC.

That’s It!!! VLC will play the portions of the video you have indicated in the m3u file.


A few points to mention:

1. If you want multiple skips in different parts of the video, you can simply add more same commands. For instance, in the following code there are two skips (from 2:47 until 4:51 and from 7:02 until 9:25):

#EXTM3U
#EXTINF:617,School.mkv
#EXTVLCOPT:start-time=1
#EXTVLCOPT:stop-time=167
School.mkv
#EXTVLCOPT:start-time=291
#EXTVLCOPT:stop-time=422
School.mkv
#EXTVLCOPT:start-time=565
#EXTVLCOPT:stop-time=617
School.mkv



2. Don’t change the number that is mentioned in the second line of the original m3u file. In my example it is 617, but it will be different in other examples. So you don’t need to change it. (It is actually the total duration of the video file in seconds).

3. These skips will not ruin the lip-sync or subtitle-sync and everything will work well.

4. Don’t forget to include the video file’s format next to the name of the file. As you see above, I have written (.mkv) wherever I have mentioned the name of the video file.


Good Luck

trysting
Blank Cone
Blank Cone
Posts: 43
Joined: 22 Aug 2008 22:11

Re: Playback control file

Postby trysting » 27 Aug 2022 23:16

I've never heard of LUA, but it appears to be dead. "Instructions to code your own VLC Lua scripts and extensions" is 404.

Lotesdelere
Cone Master
Cone Master
Posts: 9964
Joined: 08 Sep 2006 04:39
Location: Europe

Re: Playback control file

Postby Lotesdelere » 29 Aug 2022 08:36

"Instructions to code your own VLC Lua scripts and extensions" is 404.

True.
Latest versions I've found are archived here:
https://web.archive.org/web/20191214133 ... README.txt
and there:
https://web.archive.org/web/20170914063 ... README.txt


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 9 guests