Documentation:Format String/Test code

From VideoLAN Wiki
< Documentation:Format String
Revision as of 10:15, 3 April 2019 by DoesItReallyMatter (talk | contribs) (Create simple VLC command-line code for enumerating various format strings, I release under Expat/MIT License)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page contains example code for Documentation:Format String.
This code is licenced under the Expat License (often called the MIT License)

This command-line example runs through format strings in the space /[$%][A-Z_a-z]/ as a test (or novelty). It should work for VLC 3.0.x under Windows or *nix, provided that vlc is the path to VLC

  • Windows users can change to the directory of VLC or replace vlc with "%PROGRAMFILES%\VideoLAN\VLC\vlc.exe"
  • macOS users can set a Bash variable or replace vlc with /Applications/VLC.app/Contents/MacOS/VLC

BigBuckBunny.ogv can be replaced with a video of your choice. The format strings cover the screen for three seconds, then VLC exits; invalid sequences will render as literal strings.

vlc -I dummy '--sub-source=marq{marquee="A[$A] B[$B] C[$C] D[$D] E[$E] F[$F] G[$G] H[$H] I[$I] J[$J] K[$K] L[$L] M[$M] N[$N] O[$O] P[$P] Q[$Q] R[$R] S[$S] T[$T] U[$U] V[$V] W[$W] X[$X] Y[$Y] Z[$Z] a[$a] b[$b] c[$c] d[$d] e[$e] f[$f] g[$g] h[$h] i[$i] j[$j] k[$k] l[$l] m[$m] n[$n] o[$o] p[$p] q[$q] r[$r] s[$s] t[$t] u[$u] v[$v] w[$w] x[$x] y[$y] z[$z] _[$_] A[%A] B[%B] C[%C] D[%D] E[%E] F[%F] G[%G] H[%H] I[%I] J[%J] K[%K] L[%L] M[%M] N[%N] O[%O] P[%P] Q[%Q] R[%R] S[%S] T[%T] U[%U] V[%V] W[%W] X[%X] Y[%Y] Z[%Z] _[%_] a[%a] b[%b] c[%c] d[%d] e[%e] f[%f] g[%g] h[%h] i[%i] j[%j] k[%k] l[%l] m[%m] n[%n] o[%o] p[%p] q[%q] r[%r] s[%s] t[%t] u[%u] v[%v] w[%w] x[%x] y[%y] z[%z]",position=5}' --start-time=0 --stop-time=3 --no-video-title-show BigBuckBunny.ogv vlc://quit

The code is written in the format X[$X] with X[] merely marking the code used to generate the rendered X. If you prefer:

vlc -I dummy '--sub-source=marq{marquee="$A $B $C $D $E $F $G $H $I $J $K $L $M $N $O $P $Q $R $S $T $U $V $W $X $Y $Z $a $b $c $d $e $f $g $h $i $j $k $l $m $n $o $p $q $r $s $t $u $v $w $x $y $z $_ %A %B %C %D %E %F %G %H %I %J %K %L %M %N %O %P %Q %R %S %T %U %V %W %X %Y %Z %_ %a %b %c %d %e %f %g %h %i %j %k %l %m %n %o %p %q %r %s %t %u %v %w %x %y %z",position=5}' --start-time=0 --stop-time=3 --no-video-title-show BigBuckBunny.ogv vlc://quit