VIDEO_FORMAT(7)
πΈ VIDEO_FORMAT πΈ (iykyk, it's section 7)
okay bestie, this one's from the DVDAuthor Man Pages, and it's literally a whole proposal for how video format preference should work. no cap. let's get into it π
β¨ NAME β¨
video_format β Proposal For A Video Format Preference Specification π
π DESCRIPTION π
so here's the vibe. a whole bunch of programs that create or work with video material need to know whether to spit out their output in NTSC or PAL format. and the ones I've seen? they just hard-code a preference for one of them unless the user explicitly says otherwise. which means if you want the other one, you're overriding the default every single time. and that, bestie, gets tiresome. π
so obviously there needs to be a way for the user to configure one single default that applies to all of these programs. slay. and this default should be settable both per-user and systemwide, with the per-user setting overriding the systemwide one, as is usual. π
also β and this is the lowkey genius part β it makes sense to avoid dotfile clutter by following, at least to some extent, the XDG Base Directory Specification http://standards.freedesktop.org/basedir-spec/latest/. π
the preference setting itself shall consist of the single word βNTSCβ or βPALβ (without quotes, and might as well be case-insensitive, fr fr). and you can specify it in the following ways, in order of decreasing priority:
- as the value of the environment variable
VIDEO_FORMATβ - as the contents of the user-specific file
$XDG_CONFIG_HOME/video_format, with$XDG_CONFIG_HOMEdefaulting to$HOME/.configif not defined π«Ά - as the contents of a systemwide file
dir/video_format, wherediris taken in turn from the colon-separated items in the value of$XDG_CONFIG_DIRSuntil the file is found, or if$XDG_CONFIG_DIRSis not defined, then the single directory/etcπ
the application should use the first of these settings that it finds, searching in the specified order. periodt.
Note: the XDG Base Dir spec says systemwide config files should go in/etc/xdg. I'm not sure why this is, since lots of other apps put systemwide config in other places in/etc. Particularly since the spec doesn't similarly restrict shared read-only data to just one subdirectory of/usr/share. π like, make it make sense.
π¦ DISCUSSION π¦
so the big question: can this spec apply to both standard-definition and high-definition video? π€
for standard definition, there is a difference of frame size β being 720 by 480 for NTSC and 720 by 576 for PAL (and in both cases, the aspect ratio of the displayed image is always 4:3). but this doesn't seem to matter for high definition.
for both standard-definition and high-definition, there is a difference of frame rates, based around 29.97 fps for NTSC and 25 fps for PAL. π¬
also note: if a config file earlier in the search contains an invalid setting, the search does not continue, even if another, later config file might contain a valid setting. which is actually the whole point β it lets the user override a system default with βno defaultβ. is this important? I think it could be. π
π₯ REFERENCE IMPLEMENTATION π₯
the following Python code implements a routine called get_default_video_format that returns either one of the strings βNTSCβ or βPALβ indicating the user/system-configured default format as per the spec above, or None if the default is invalid or not configured. π
class xdg_base_dir :
"Implementation of relevant parts of the XDG Base Directory specification" \
" <http://standards.freedesktop.org/basedir-spec/latest/>."
@classmethod
def get_config_home(self) :
"returns the directory for holding user-specific config files."
result = os.environ.get("XDG_CONFIG_HOME")
if result == None :
result = os.path.join(os.environ["HOME"], ".config")
#end if
return result
#end get_config_home
@classmethod
def config_search_path(self) :
"returns the list of config directories to search (apart from the user area)."
return tuple(os.environ.get("XDG_CONFIG_DIRS", "/etc").split(":"))
# note spec actually says default should be /etc/xdg, but /etc is the
# conventional location for system config files.
#end config_search_path
@classmethod
def find_first_config_path(self, path) :
"searches for path in all the config directory locations in order of decreasing" \
" priority, returning the expansion where it is first found, or None if not found."
paths_to_try = iter((self.get_config_home(),) + self.config_search_path())
# highest priority first
while True :
this_path = next(paths_to_try, None)
if this_path == None :
break
this_path = os.path.join(this_path, path)
if os.path.exists(this_path) :
break
#end while
return this_path
#end find_first_config_path
#end xdg_base_dir
valid_video_formats = frozenset(("NTSC", "PAL"))
def get_default_video_format() :
video_format = os.environ.get("VIDEO_FORMAT")
if video_format == None :
config_file = xdg_base_dir.find_first_config_path("video_format")
if config_file != None :
try :
video_format = open(config_file, "r").readline().strip()
except OSError :
video_format = None
#end try
#end if
#end if
if video_format != None :
video_format = video_format.upper()
if video_format not in valid_video_formats :
video_format = None
#end if
#end if
return video_format
#end get_default_video_format
okay that's the whole thing, bestie, you ate it π
β¨ this was the DVDAuthor Man Pages rendition of VIDEO_FORMAT(7), dated Fri Dec 30 19:47:26 CET 2005 π go set your VIDEO_FORMAT and be free πΈπ¦
π¦ where this page comes from
- alpine 3.24: dvdauthor-doc 0.7.2-r11 Β· GPL-2.0-or-later
- arch rolling: dvdauthor 0.7.2-16 Β· GPL-2.0-or-later
- debian bookworm: dvdauthor 0.7.2-2 Β· GPL-2.0-or-later
- debian trixie: dvdauthor 0.7.2-3 Β· GPL-2.0-or-later
- epel 10: dvdauthor 0.7.2-25.el10_0 Β· GPL-2.0-or-later
- epel 9: dvdauthor 0.7.2-18.el9 Β· GPLv2+
- fedora 43: dvdauthor 0.7.2-28.fc43 Β· GPL-2.0-or-later
- fedora 44: dvdauthor 0.7.2-29.fc44 Β· GPL-2.0-or-later
- nixos 26.05: dvdauthor 0.7.2
- nixpkgs unstable: dvdauthor 0.7.2
- ubuntu jammy: dvdauthor 0.7.2-1build2
- ubuntu noble: dvdauthor 0.7.2-2build4 Β· GPL-2.0-or-later
- ubuntu questing: dvdauthor 0.7.2-3build1
- ubuntu resolute: dvdauthor 0.7.2-3build2 Β· GPL-2.0-or-later
- ubuntu stonking: dvdauthor 0.7.2-3build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms