|
| 1 | +# FFmpeg Low-Level Reference |
| 2 | + |
| 3 | +This page documents low-level FFmpeg constants, types, and functions that are available through VideoIO's `libffmpeg` module. |
| 4 | + |
| 5 | +```@contents |
| 6 | +Pages = ["ffmpeg_reference.md"] |
| 7 | +Depth = 2 |
| 8 | +``` |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +VideoIO provides Julia bindings to FFmpeg through the `VideoIO.libffmpeg` module. This module contains over 1,000 functions, constants, and types from FFmpeg's C libraries. While most users will use VideoIO's high-level API (see [Reading Videos](@ref) and [Writing Videos](@ref)), advanced users may need direct access to FFmpeg functionality. |
| 13 | + |
| 14 | +### FFmpeg Subpackages |
| 15 | + |
| 16 | +Each FFmpeg library is exposed as a VideoIO subpackage: |
| 17 | + |
| 18 | +| FFmpeg Library | VideoIO Module | Description | |
| 19 | +|----------------|----------------|-------------| |
| 20 | +| `libavcodec` | `AVCodecs` | Codec library - encoding/decoding | |
| 21 | +| `libavdevice` | `AVDevice` | Device library - camera/screen capture | |
| 22 | +| `libavfilter` | `AVFilters` | Filter library - video/audio processing | |
| 23 | +| `libavformat` | `AVFormat` | Format library - muxing/demuxing | |
| 24 | +| `libavutil` | `AVUtil` | Utility library - common functions | |
| 25 | +| `libswscale` | `SWScale` | Scaling library - pixel format conversion | |
| 26 | +| `libswresample` | `SWResample` | Resampling library - audio conversion | |
| 27 | + |
| 28 | +### Usage Example |
| 29 | + |
| 30 | +```julia |
| 31 | +using VideoIO |
| 32 | + |
| 33 | +# Access low-level FFmpeg functionality |
| 34 | +import VideoIO.libffmpeg |
| 35 | + |
| 36 | +# Check pixel format constant |
| 37 | +pix_fmt = VideoIO.libffmpeg.AV_PIX_FMT_RGB24 |
| 38 | + |
| 39 | +# Use AVRational for time base |
| 40 | +time_base = VideoIO.libffmpeg.AVRational(1, 30) # 1/30 second per frame |
| 41 | + |
| 42 | +# Convert to Julia Rational |
| 43 | +julia_rational = Rational(time_base.num, time_base.den) |
| 44 | +``` |
| 45 | + |
| 46 | +### Key Concepts |
| 47 | + |
| 48 | +**Pixel Formats**: FFmpeg supports numerous pixel formats via `AV_PIX_FMT_*` constants. Common ones include: |
| 49 | + |
| 50 | +- `AV_PIX_FMT_RGB24` - Packed RGB 8:8:8, 24bpp |
| 51 | +- `AV_PIX_FMT_GRAY8` - Grayscale, 8bpp |
| 52 | +- `AV_PIX_FMT_YUV420P` - Planar YUV 4:2:0, 12bpp |
| 53 | + |
| 54 | +**Media Types**: Stream types are identified by `AVMEDIA_TYPE_*` constants: |
| 55 | + |
| 56 | +- `AVMEDIA_TYPE_VIDEO` - Video stream |
| 57 | +- `AVMEDIA_TYPE_AUDIO` - Audio stream |
| 58 | +- `AVMEDIA_TYPE_SUBTITLE` - Subtitle stream |
| 59 | + |
| 60 | +**Special Values**: |
| 61 | + |
| 62 | +- `AV_NOPTS_VALUE` - Indicates no presentation timestamp (0x8000000000000000) |
| 63 | +- `AVPROBE_SCORE_MAX` - Maximum probe score (100) |
| 64 | + |
| 65 | +**Codec Properties**: |
| 66 | + |
| 67 | +- `AV_CODEC_PROP_FIELDS` - Flag indicating field-based (interlaced) codec support |
| 68 | + |
| 69 | +For detailed information on FFmpeg 8 compatibility changes, see: |
| 70 | + |
| 71 | +- [FFmpeg ticks_per_frame deprecation](https://github.com/FFmpeg/FFmpeg/commit/7d1d61cc5f57708434ba720b03234b3dd93a4d1e) |
| 72 | +- [AVCodecContext.time_base documentation](https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a17f4c12d8b7693dbbcdab8ed765ab7ce) |
| 73 | + |
| 74 | +## Complete API Reference |
| 75 | + |
| 76 | +The following sections provide auto-generated documentation for all exported items in `VideoIO.libffmpeg`. |
| 77 | + |
| 78 | +### Functions |
| 79 | + |
| 80 | +```@autodocs |
| 81 | +Modules = [VideoIO.libffmpeg] |
| 82 | +Order = [:function] |
| 83 | +``` |
| 84 | + |
| 85 | +### Types |
| 86 | + |
| 87 | +```@autodocs |
| 88 | +Modules = [VideoIO.libffmpeg] |
| 89 | +Order = [:type] |
| 90 | +``` |
| 91 | + |
| 92 | +### Constants |
| 93 | + |
| 94 | +```@autodocs |
| 95 | +Modules = [VideoIO.libffmpeg] |
| 96 | +Order = [:constant] |
| 97 | +``` |
| 98 | + |
| 99 | +## See Also |
| 100 | + |
| 101 | +- [Reading Videos](@ref) |
| 102 | +- [Writing Videos](@ref) |
| 103 | +- [Low level functionality](@ref) |
| 104 | +- [FFmpeg Official Documentation](https://ffmpeg.org/documentation.html) |
0 commit comments