How to run cvlc closing after the play

Solution 1:

There are two ways you can instruct VLC to quit playback after the playlist is played fully:

  1. By supplying the --play-and-exit CLI option, e.g.:

    cvlc --play-and-exit audio1.mp3 audio2.mp3
    

    or

    vlc --play-and-exit audio1.mp3 audio2.mp3
    

    or creating a bash alias (in ~/.bashrc):

    alias cvlc='cvlc --play-and-exit'
    
  2. By adding the dummy item vlc://quit to your playlist, e.g.:

    cvlc audio1.mp3 audio2.mp3 vlc://quit
    

    or

    vlc audio1.mp3 audio2.mp3 vlc://quit
    

Source: https://stackoverflow.com/q/10249261/1708932