This is an old revision of the document!
FL, FC, FR, BL, BR, LFE → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.374107*FC + 0.529067*FL + 0.458186*BL + 0.264534*BR + 0.374107*LFE |FR = 0.374107*FC + 0.529067*FR + 0.458186*BR + 0.264534*BL + 0.374107*LFE" \
FL, FC, FR, SL, SR, BL, BR, LFE → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.274804*FC + 0.388631*FL + 0.336565*SL + 0.194316*SR + 0.336565*BL + 0.194316*BR + 0.274804*LFE | FR = 0.274804*FC + 0.388631*FR + 0.336565*SR + 0.194316*SL + 0.336565*BR + 0.194316*BL + 0.274804*LFE" \
FL, FC, FR, SL, SR, BC, LFE → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.321953*FC + 0.455310*FL + 0.394310*SL + 0.227655*SR + 278819*BC + 0.321953*LFE | FR = 0.321953*FC + 0.455310*FR + 0.394310*SR + 0.227655*SL + 278819*BC + 0.321953*LFE" \
FL, FC, FR, BL, BR → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.460186*FC + 0.650802*FL + 0.563611*BL + 0.325401*BR | FR = 0.460186*FC + 0.650802*FR + 0.563611*BR + 0.325401*BL" \
FL, FR, BL, BR → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.422650*FL + 0.366025*BL + 0.211325*BR | FR = 0.422650*FR + 0.366025*BR + 0.211325*BL" \
FL, FC, FR → FL, FR
-ac 2 \ -af "pan=stereo|FL = 0.414214*FC + 0.585786*FL | FR = 0.414214*FC + 0.585786*FR" \
Quality with QSV as not good at all, though this could have been my fault.
ffmpeg \ -y \ -hwaccel qsv \ -qsv_device /dev/dri/card0 \ -c:v hevc_qsv \ -i input.mkv \ -c:v hevc_qsv \ -vf 'scale_qsv=w=1920' \ -preset slow \ -global_quality 25 \ -c:a copy \ -c:s copy \ output.mkv
ffmpeg \ -i MyMovie_4K.mkv \ -vf scale=1920:-1 \ -c:v libx265 \ -preset veryslow \ -c:a copy \ MyMovie_1080p.mkv
Not sure if these are necessary.
-crf 28
ffmpeg \ -i in.mkv \ -f srt \ -i in.srt \ -map 0:0 \ -map 0:1 \ -map 1:0 \ -c:v copy \ -c:a copy \ -c:s srt \ out.mkv
http://diantokam.blogspot.com/2016/12/adding-subtitle-and-scaling-film-using.html
ffmpeg \ -i "input.mkv" \ -vf subtitles=fullsubs.srt \ "output.mkv"
# export english subs ffmpeg \ -y \ -i "./${name}" \ -map 0:s:0 \ eng.srt # create a version with hardsubs # si=0 ffmpeg \ -y \ -i "./${name}" \ -vf subtitles="${name}":si=0 \ -ac 2 \ -af "pan=stereo|FL = 0.374107*FC + 0.529067*FL + 0.458186*BL + 0.264534*BR + 0.374107*LFE |FR = 0.374107*FC + 0.529067*FR + 0.458186*BR + 0.264534*BL + 0.374107*LFE" \ -c:a aac \ "${name}-hardsubs.mp4"
ffmpeg \ -itsoffset -1 \ -i full8.srt \ -c copy \ full8_delayed.srt
https://hub.docker.com/r/tiangolo/nginx-rtmp https://www.nginx.com/blog/video-streaming-for-remote-learning-with-nginx/
ffmpeg -h encoder=hevc_qsv
ffmpeg \ -i input.mkv \ -ss 29:36 \ -to 29:50 \ -c:v copy \ -c:a aac \ output.mp4
docker run \ -v $(pwd):$(pwd) \ -w $(pwd) \ --runtime=nvidia jrottenberg/ffmpeg:4.1-nvidia \ -hwaccel cuvid \ -c:v h264_cuvid \ -i input.mkv \ -c:v hevc_nvenc \ -c:a copy \ -c:s copy \ -preset slow \ output_hevc.mkv
[h264 @ 0x56028de15ec0] Error creating a NVDEC decoder: 1 [h264 @ 0x56028de15ec0] Using more than 32 (34) decode surfaces might cause nvdec to fail. [h264 @ 0x56028de15ec0] Try lowering the amount of threads. Using 16 right now. [h264 @ 0x56028de15ec0] Failed setup for format cuda: hwaccel initialisation returned error.
Note that cuda hwaccel is an alias to the newer nvdec implementation, and to my knowledge, has no way of setting up decoder surface limits.
Here's a workaround you can try:
ffmpeg \ -threads 4 \ -hide_banner \ -c:v h264_cuvid \ -surfaces 8 \ -nostats \ -i rtmp://<ip>:<port>/myapp/mystream \ -filter_complex [0]fps=fps=1[s0] \ -map [s0] \ -f rawvideo \ -pix_fmt rgb24 pipe
Two changes:
1: Call up the h264_cuvid decoder directly, and apply a surface limit count of 8. This should be adequate.
2: Limit the thread count.
None of this worked.
[matroska @ 0x55a1a3738340] Non-monotonous DTS in output stream 0:1; previous: 490791, current: 490731; changing to 490791. This may result in incorrect timestamps in the output file.
Try -use_wallclock_as_timestamps 1
and -fflags +genpts
Add the following after the input file:
-max_muxing_queue_size 9999
[matroska @ 0x55e337388d80] Subtitle codec 96257 is not supported. Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented Error initializing output stream 0:1 -- Conversion failed!