mirror of
https://github.com/sbrow/nu-ffmpeg.git
synced 2025-12-29 16:23:11 -05:00
docs: Added examples to README.md.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.direnv
|
||||
examples/videos/**
|
||||
|
||||
11
.gomplate.yml
Normal file
11
.gomplate.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
inputFiles:
|
||||
- README.md.tmpl
|
||||
outputFiles:
|
||||
- README.md
|
||||
plugins:
|
||||
filters: ./get_filter_support_table
|
||||
ffprobe: ./get_ffprobe_commands_table
|
||||
version: ./nu_version
|
||||
ffprobe_example: ./examples/ffprobe.nu
|
||||
pluginTimeout: 10s
|
||||
|
||||
16
Makefile
16
Makefile
@@ -1,7 +1,17 @@
|
||||
README.md:
|
||||
gomplate -f $@.tmpl --plugin "filters=./get_filter_support_table,ffprobe=./get_ffprobe_commands_table,version=./nu_version" > $@
|
||||
SHELL:=/nix/store/zicq9x6aznw7x202564p8iy0rm04py6l-nushell-0.89.0/bin/nu
|
||||
|
||||
all: README.md
|
||||
|
||||
README.md: examples/videos/sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4
|
||||
gomplate --config .gomplate.yml -V
|
||||
|
||||
examples/videos/sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4:
|
||||
wget -x -P examples/videos https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4
|
||||
|
||||
clean:
|
||||
rm -f README.md
|
||||
|
||||
.PHONY: clean
|
||||
clean-all: clean
|
||||
rm -rf examples/videos/**
|
||||
|
||||
.PHONY: clean all
|
||||
|
||||
16
README.md
16
README.md
@@ -6,6 +6,22 @@ Utility commands for working with ffmpeg in nushell.
|
||||
## Capabilities
|
||||
|
||||
- Return tables from `ffprobe`
|
||||
|
||||
```nu
|
||||
> ffprobe https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4
|
||||
╭────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────╮
|
||||
│ # │ streams │ ... │
|
||||
├────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────┤
|
||||
│ 0 │ ╭───┬────────────┬───────────────────────────────────────────┬─────────┬────────────┬──────────────────┬────────────┬─────╮ │ ... │
|
||||
│ │ │ # │ codec_name │ codec_long_name │ profile │ codec_type │ codec_tag_string │ codec_tag │ ... │ │ │
|
||||
│ │ ├───┼────────────┼───────────────────────────────────────────┼─────────┼────────────┼──────────────────┼────────────┼─────┤ │ │
|
||||
│ │ │ 0 │ h264 │ H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 │ Main │ video │ avc1 │ 0x31637661 │ ... │ │ │
|
||||
│ │ │ 1 │ aac │ AAC (Advanced Audio Coding) │ LC │ audio │ mp4a │ 0x6134706d │ ... │ │ │
|
||||
│ │ ╰───┴────────────┴───────────────────────────────────────────┴─────────┴────────────┴──────────────────┴────────────┴─────╯ │ │
|
||||
╰────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────╯
|
||||
|
||||
```
|
||||
|
||||
- `ffprobe` multiple files at once
|
||||
- Use `streams`, `streams video`, and `streams audio` to filter `ffprobe` output
|
||||
- get the `dimensions` of a video stream as a record
|
||||
|
||||
@@ -11,6 +11,11 @@ Utility commands for working with ffmpeg in nushell.
|
||||
## Capabilities
|
||||
|
||||
- Return tables from `ffprobe`
|
||||
|
||||
```nu
|
||||
{{ ffprobe_example }}
|
||||
```
|
||||
|
||||
- `ffprobe` multiple files at once
|
||||
- Use `streams`, `streams video`, and `streams audio` to filter `ffprobe` output
|
||||
- get the `dimensions` of a video stream as a record
|
||||
|
||||
6
examples/ffprobe.nu
Executable file
6
examples/ffprobe.nu
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
use ../ffprobe;
|
||||
|
||||
echo "> ffprobe https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4"
|
||||
ffprobe $'($env.FILE_PWD)/videos/sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4'
|
||||
Reference in New Issue
Block a user