Add examples
Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
parent
bae9dcf57c
commit
08246a1816
80
README.md
80
README.md
@ -21,6 +21,86 @@ docker run \
|
|||||||
intel-media-ffmpeg
|
intel-media-ffmpeg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Usage examples
|
||||||
|
|
||||||
|
Download stream:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir media
|
||||||
|
cd media
|
||||||
|
wget https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
|
## Decode
|
||||||
|
|
||||||
|
H264 video decode and save as raw file:
|
||||||
|
|
||||||
|
### Connect to container
|
||||||
|
```bash
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--device=/dev/dri \
|
||||||
|
--volume $(pwd)/media:/media \
|
||||||
|
-it \
|
||||||
|
intel-media-ffmpeg \
|
||||||
|
ffmpeg -hwaccel qsv -c:v h264_qsv -i /media/AUD_MW_E.264 \
|
||||||
|
-vf hwdownload,format=nv12 -pix_fmt yuv420p \
|
||||||
|
/media/AUD_MW.yuv
|
||||||
|
```
|
||||||
|
|
||||||
|
### Encode
|
||||||
|
|
||||||
|
Encode a 10 frames of 720p raw input as H264 with 5Mbps using VBR mode:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--device=/dev/dri \
|
||||||
|
--volume $(pwd)/media:/media \
|
||||||
|
-it \
|
||||||
|
intel-media-ffmpeg \
|
||||||
|
ffmpeg -loglevel debug -init_hw_device qsv=hw \
|
||||||
|
-filter_hw_device hw -f rawvideo -pix_fmt \
|
||||||
|
yuv420p -s:v 176x144 -i /media/AUD_MW.yuv -vf \
|
||||||
|
hwupload=extra_hw_frames=64,format=qsv \
|
||||||
|
-c:v h264_qsv -b:v 5M -frames:v 10 \
|
||||||
|
-y /media/AUD_MW_E.h264
|
||||||
|
```
|
||||||
|
|
||||||
|
### Transcode
|
||||||
|
|
||||||
|
H264 decode && H265 encode with 5Mbps using VBR
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--device=/dev/dri \
|
||||||
|
--volume $(pwd)/media:/media \
|
||||||
|
-it \
|
||||||
|
intel-media-ffmpeg \
|
||||||
|
ffmpeg -hwaccel qsv -c:v h264_qsv -i /media/AUD_MW_E.264 \
|
||||||
|
-c:v hevc_qsv -b:v 5M AUD_MW_E.hevc
|
||||||
|
```
|
||||||
|
|
||||||
|
1:N transcoding
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--device=/dev/dri \
|
||||||
|
--volume $(pwd)/media:/media \
|
||||||
|
-it \
|
||||||
|
intel-media-ffmpeg \
|
||||||
|
ffmpeg -hwaccel qsv -c:v h264_qsv \
|
||||||
|
-i /media/AUD_MW_E.264 \
|
||||||
|
-filter_complex "split=2[s1][s2]; \
|
||||||
|
[s1]scale_qsv=1280:720[o1]; \
|
||||||
|
[s2]vpp_qsv=framerate=60[o2]" \
|
||||||
|
-map [o1] -c:v h264_qsv -b:v 5M /media/5M.mp4 \
|
||||||
|
-map [o2] -c:v h264_qsv -b:v 4M /media/4M60FPS.h264
|
||||||
|
```
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
The Dockerfile itself is constructed from re-usable snippets,
|
The Dockerfile itself is constructed from re-usable snippets,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user