Closed cradcore closed 2 years ago
Do you have a version of the FFMPEG command that works with your hardware? I can potentially guide you on how to modify your settings to achieve that but it's up to your to figure out what hardware acceleration options, formats, and devices you want to use with FFMPEG
You can also try using less options which will let FFMPEG automatically decide certain settings
Can try dropping formats and see if that helps, similarly devices and decoders can be left blank to let FFMPEG auto detect though if you want to define things to avoid all software layers entirely then you'll need to be more specific. This gets more complex if you're using any filters where you'll have to sometimes change formats on the fly
hwaccel-output-format =
This may be helpful too
https://stackoverflow.com/questions/66505989/ffmpeg-hwaccel-no-decoder-surfaces-left
Can use postopts to add this parameter
Thank you for the quick and helpful response. FFMPEG does work just fine when leaving the options as their defaults, it just takes awhile so I was trying to get hardware acceleration working to improve performance. I have a GTX 1070 TI. I'll admit I feel a little out of my league with trying to figure out which options to choose to accomplish this. I would greatly appreciate some help in figuring out which options to choose to utilize this. I can rebuild ffmpeg as well if I missed something. My goal is to minimize transcoding on my server and convert the media into a common format regardless of device its streaming to. Not sure if any of the following helps, but here is the output of a few commands:
$ ffmpeg -hwaccels
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-cuda --enable-cuvid --enable-fontconfig --enable-gpl --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libfdk_aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libnpp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libsrt --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzmq --enable-nonfree --enable-nvenc --enable-openssl --enable-parser=acc --enable-parser=h264 --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags='-I/install/include -I/install/include/ffnvcodec -I/usr/local/cuda/include/' --extra-ldflags='-L/install/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/' --extra-libs=-ldl --extra-libs=-lpthread --prefix=/install
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Hardware acceleration methods:
cuda
$ ffmpeg --decoders
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-cuda --enable-cuvid --enable-fontconfig --enable-gpl --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libfdk_aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libnpp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libsrt --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzmq --enable-nonfree --enable-nvenc --enable-openssl --enable-parser=acc --enable-parser=h264 --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags='-I/install/include -I/install/include/ffnvcodec -I/usr/local/cuda/include/' --extra-ldflags='-L/install/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/' --extra-libs=-ldl --extra-libs=-lpthread --prefix=/install
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Decoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
------
V....D 012v
V....D 4xm
V....D 8bps
V....D aasc
V....D agm
VF...D aic
V....D alias_pix
V....D amv
V....D anm
V....D ansi
VF...D apng
V....D arbc
V....D argo
V....D asv1
V....D asv2
V....D aura
V....D aura2
V....D libaom-av1 (codec av1)
V....D av1
V..... av1_cuvid (codec av1)
V....D avrn
V....D avrp
V....D avs
V....D avui
V....D ayuv
V....D bethsoftvid
V....D bfi
V....D binkvideo
V....D bintext
VF.... bitpacked
V....D bmp
V....D bmv_video
V....D brender_pix
V....D c93
V....D cavs
V....D cdgraphics
V....D cdtoons
V....D cdxl
VF...D cfhd
V....D cinepak
V....D clearvideo
V....D cljr
VF...D cllc
V....D eacmv (codec cmv)
V....D cpia
VF...D cri
V....D camstudio (codec cscd)
V....D cyuv
V.S..D dds
V....D dfa
V.S..D dirac
VFS..D dnxhd
V....D dpx
V....D dsicinvideo
VFS..D dvvideo
V....D dxa
VF...D dxtory
VFS..D dxv
V....D escape124
V....D escape130
VFS..D exr
VFS..D ffv1
VF..BD ffvhuff
V.S..D fic
V....D fits
V....D flashsv
V....D flashsv2
V....D flic
V...BD flv (codec flv1)
V....D fmvc
VF...D fraps
V....D frwu
V....D g2m
V....D gdv
V....D gem
V....D gif
V....D h261
V...BD h263
V..... h263_v4l2m2m (codec h263)
V...BD h263i
V...BD h263p
VFS..D h264
V..... h264_v4l2m2m (codec h264)
V..... h264_cuvid (codec h264)
VFS..D hap
VFS..D hevc
V..... hevc_v4l2m2m (codec hevc)
V..... hevc_cuvid (codec hevc)
V....D hnm4video
V....D hq_hqa
VFS..D hqx
VF..BD huffyuv
VF..BD hymt
V....D idcinvideo (codec idcin)
V....D idf
V....D iff (codec iff_ilbm)
V....D imm4
V..... imm5
V....D indeo2
V....D indeo3
V....D indeo4
V....D indeo5
V....D interplayvideo
V....D ipu
VFS..D jpeg2000
VF...D libopenjpeg (codec jpeg2000)
V....D jpegls
V....D jv
V....D kgv1
V....D kmvc
VF...D lagarith
V....D loco
V....D lscr
V....D m101
V....D eamad (codec mad)
VFS..D magicyuv
VF...D mdec
VF...D mimic
V....D mjpeg
V..... mjpeg_cuvid (codec mjpeg)
V....D mjpegb
V....D mmvideo
V....D mobiclip
V....D motionpixels
V.S.BD mpeg1video
V..... mpeg1_v4l2m2m (codec mpeg1video)
V..... mpeg1_cuvid (codec mpeg1video)
V.S.BD mpeg2video
V.S.BD mpegvideo (codec mpeg2video)
V..... mpeg2_v4l2m2m (codec mpeg2video)
V..... mpeg2_cuvid (codec mpeg2video)
VF..BD mpeg4
V..... mpeg4_v4l2m2m (codec mpeg4)
V..... mpeg4_cuvid (codec mpeg4)
V....D msa1
V....D mscc
V...BD msmpeg4v1
V...BD msmpeg4v2
V...BD msmpeg4 (codec msmpeg4v3)
V....D msp2
V....D msrle
V....D mss1
V....D mss2
V....D msvideo1
VF...D mszh
V....D mts2
V....D mv30
V....D mvc1
V....D mvc2
V....D mvdv
V....D mvha
V....D mwsc
V....D mxpeg
VF...D notchlc
V....D nuv
V....D paf_video
V....D pam
V....D pbm
V....D pcx
V....D pfm
V....D pgm
V....D pgmyuv
V....D pgx
V....D phm
VF...D photocd
V....D pictor
VF...D pixlet
VF...D png
V....D ppm
VFS..D prores
V....D prosumer
VF...D psd
V....D ptx
V....D qdraw
VF...D qoi
V....D qpeg
V....D qtrle
V....D r10k
V....D r210
V....D rasc
V..... rawvideo
V....D rl2
V....D roqvideo (codec roq)
V....D rpza
V....D rscc
V....D rv10
V....D rv20
VF...D rv30
VF...D rv40
V....D sanm
V....D scpr
V....D screenpresso
V....D sga
V....D sgi
V....D sgirle
VF...D sheervideo
V....D simbiosis_imx
V....D smackvid (codec smackvideo)
V....D smc
V....D smvjpeg
V....D snow
V....D sp5x
V....D speedhq
V....D srgc
V....D sunrast
V....D svq1
V...BD svq3
V....D targa
V....D targa_y216
V....D tdsc
V....D eatgq (codec tgq)
V....D eatgv (codec tgv)
VF..BD theora
V....D thp
V....D tiertexseqvideo
VF...D tiff
V....D tmv
V....D eatqi (codec tqi)
V....D truemotion1
V....D truemotion2
V....D truemotion2rt
V....D camtasia (codec tscc)
V....D tscc2
V....D txd
V....D ultimotion (codec ulti)
VF...D utvideo
VFS..D v210
V....D v210x
V....D v308
V....D v408
VFS..D v410
V....D vb
VF...D vble
V.S..D vbn
V....D vc1
V..... vc1_v4l2m2m (codec vc1)
V..... vc1_cuvid (codec vc1)
V....D vc1image
V....D vcr1
V....D xl (codec vixl)
V....D vmdvideo
V....D vmnc
VF..BD vp3
VF..BD vp4
V....D vp5
V....D vp6
V.S..D vp6a
V....D vp6f
V....D vp7
VFS..D vp8
V..... vp8_v4l2m2m (codec vp8)
V....D libvpx (codec vp8)
V..... vp8_cuvid (codec vp8)
VFS..D vp9
V..... vp9_v4l2m2m (codec vp9)
V..... libvpx-vp9 (codec vp9)
V..... vp9_cuvid (codec vp9)
V....D wcmv
VF...D webp
V...BD wmv1
V...BD wmv2
V....D wmv3
V....D wmv3image
V....D wnv1
V..... wrapped_avframe
V....D vqavideo (codec ws_vqa)
V....D xan_wc3
V....D xan_wc4
V....D xbin
V....D xbm
V....D xface
V....D xpm
V....D xwd
V....D y41p
VF...D ylc
V..... yop
V....D yuv4
V....D zerocodec
VF...D zlib
V....D zmbv
A....D 8svx_exp
A....D 8svx_fib
A....D aac
A....D aac_fixed (codec aac)
A....D libfdk_aac (codec aac)
A....D aac_latm
A....D ac3
A....D ac3_fixed (codec ac3)
A....D acelp.kelvin
A....D adpcm_4xm
A....D adpcm_adx
A....D adpcm_afc
A....D adpcm_agm
A....D adpcm_aica
A....D adpcm_argo
A....D adpcm_ct
A....D adpcm_dtk
A....D adpcm_ea
A....D adpcm_ea_maxis_xa
A....D adpcm_ea_r1
A....D adpcm_ea_r2
A....D adpcm_ea_r3
A....D adpcm_ea_xas
A....D g722 (codec adpcm_g722)
A....D g726 (codec adpcm_g726)
A....D g726le (codec adpcm_g726le)
A....D adpcm_ima_acorn
A....D adpcm_ima_alp
A....D adpcm_ima_amv
A....D adpcm_ima_apc
A....D adpcm_ima_apm
A....D adpcm_ima_cunning
A....D adpcm_ima_dat4
A....D adpcm_ima_dk3
A....D adpcm_ima_dk4
A....D adpcm_ima_ea_eacs
A....D adpcm_ima_ea_sead
A....D adpcm_ima_iss
A....D adpcm_ima_moflex
A....D adpcm_ima_mtf
A....D adpcm_ima_oki
A....D adpcm_ima_qt
A....D adpcm_ima_rad
A....D adpcm_ima_smjpeg
A....D adpcm_ima_ssi
A....D adpcm_ima_wav
A....D adpcm_ima_ws
A....D adpcm_ms
A....D adpcm_mtaf
A....D adpcm_psx
A....D adpcm_sbpro_2
A....D adpcm_sbpro_3
A....D adpcm_sbpro_4
A....D adpcm_swf
A....D adpcm_thp
A....D adpcm_thp_le
A....D adpcm_vima
A....D adpcm_xa
A....D adpcm_yamaha
A....D adpcm_zork
AF...D alac
A....D amrnb (codec amr_nb)
A....D libopencore_amrnb (codec amr_nb)
A....D amrwb (codec amr_wb)
A....D libopencore_amrwb (codec amr_wb)
A....D ape
A....D aptx
A....D aptx_hd
A....D atrac1
A....D atrac3
A....D atrac3al
A....D atrac3plus (codec atrac3p)
A....D atrac3plusal (codec atrac3pal)
A....D atrac9
A....D on2avc (codec avc)
A....D binkaudio_dct
A....D binkaudio_rdft
A....D bmv_audio
A....D comfortnoise
A....D cook
A....D derf_dpcm
A....D dfpwm
A....D dolby_e
A.S..D dsd_lsbf
A.S..D dsd_lsbf_planar
A.S..D dsd_msbf
A.S..D dsd_msbf_planar
A....D dsicinaudio
A....D dss_sp
A....D dst
A....D dca (codec dts)
A....D dvaudio
A....D eac3
A....D evrc
A....D fastaudio
AF...D flac
A....D g723_1
A....D g729
A....D gremlin_dpcm
A....D gsm
A....D gsm_ms
A....D hca
A....D hcom
A....D iac
A....D ilbc
A....D imc
A....D interplay_dpcm
A....D interplayacm
A....D mace3
A....D mace6
A....D metasound
A....D mlp
A....D mp1
A....D mp1float (codec mp1)
A....D mp2
A....D mp2float (codec mp2)
A....D mp3float (codec mp3)
A....D mp3
A....D mp3adufloat (codec mp3adu)
A....D mp3adu
A....D mp3on4float (codec mp3on4)
A....D mp3on4
A....D als (codec mp4als)
A....D msnsiren
A....D mpc7 (codec musepack7)
A....D mpc8 (codec musepack8)
A....D nellymoser
A....D opus
A....D libopus (codec opus)
A....D paf_audio
A....D pcm_alaw
A....D pcm_bluray
A....D pcm_dvd
A....D pcm_f16le
A....D pcm_f24le
A....D pcm_f32be
A....D pcm_f32le
A....D pcm_f64be
A....D pcm_f64le
A....D pcm_lxf
A....D pcm_mulaw
A....D pcm_s16be
A....D pcm_s16be_planar
A....D pcm_s16le
A....D pcm_s16le_planar
A....D pcm_s24be
A....D pcm_s24daud
A....D pcm_s24le
A....D pcm_s24le_planar
A....D pcm_s32be
A....D pcm_s32le
A....D pcm_s32le_planar
A....D pcm_s64be
A....D pcm_s64le
A....D pcm_s8
A....D pcm_s8_planar
A....D pcm_sga
A....D pcm_u16be
A....D pcm_u16le
A....D pcm_u24be
A....D pcm_u24le
A....D pcm_u32be
A....D pcm_u32le
A....D pcm_u8
A....D pcm_vidc
A....D qcelp
A....D qdm2
A....D qdmc
A....D real_144 (codec ra_144)
A....D real_288 (codec ra_288)
A....D ralf
A....D roq_dpcm
A....D s302m
A....D sbc
A....D sdx2_dpcm
A....D shorten
A....D sipr
A....D siren
A....D smackaud (codec smackaudio)
A....D sol_dpcm
A..X.D sonic
A....D speex
AF...D tak
A....D truehd
A....D truespeech
AF...D tta
A....D twinvq
A....D vmdaudio
A....D vorbis
A..... libvorbis (codec vorbis)
A....D wavesynth
AFS..D wavpack
A....D ws_snd1 (codec westwood_snd1)
A....D wmalossless
A....D wmapro
A....D wmav1
A....D wmav2
A....D wmavoice
A....D xan_dpcm
A....D xma1
A....D xma2
S..... libaribb24 (codec arib_caption)
S..... ssa (codec ass)
S..... ass
S..... dvbsub (codec dvb_subtitle)
S..... dvdsub (codec dvd_subtitle)
S..... cc_dec (codec eia_608)
S..... pgssub (codec hdmv_pgs_subtitle)
S..... jacosub
S..... microdvd
S..... mov_text
S..... mpl2
S..... pjs
S..... realtext
S..... sami
S..... stl
S..... srt (codec subrip)
S..... subrip
S..... subviewer
S..... subviewer1
S..... text
S..... vplayer
S..... webvtt
S..... xsub
The link you posted did (kind of) do the trick. When adding it to postops, it outputs the following:
Manual processor started.
Python 64-bit 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0].
Guessit version: 3.4.3.
/usr/bin/python3
Loading config file /opt/autoProcess.ini.
Matched TV episode as Atlanta (TMDB ID: 65495) S04E04
Processing Atlanta Season 04 Episode 04 - Light Skinned-Ed
Input Data
{
"format": "matroska,webm",
"format-fullname": "unknown",
"video": {
"index": 0,
"codec": "h264",
"bitrate": 5655204,
"pix_fmt": "yuv420p",
"profile": "100",
"fps": 23.976023976023978,
"framedata": {
"pix_fmt": "yuv420p",
"color_space": "bt709",
"color_primaries": "bt709",
"color_transfer": "bt709"
},
"dimensions": "1280x720",
"level": 3.1,
"field_order": "progressive"
},
"audio": [
{
"index": 1,
"codec": "eac3",
"bitrate": 640000,
"channels": 6,
"samplerate": 48000,
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
}
],
"subtitle": [
{
"index": 2,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "eng"
}
],
"attachment": []
}
Reading video stream.
Video codec detected: h264.
Pix Fmt: yuv420p.
Profile: 100.
Video codec parameters None.
Creating h264_nvenc video stream from source stream 0.
Reading audio streams.
The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
Audio detected for stream 1 - eac3 eng 6 channel.
Creating ac3 audio stream from source stream 1.
Creating aac audio stream from source audio stream 1 [universal-audio].
Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
Final sorting:
['0->0', '1->1']
Final sorting:
['0->0', '1->1']
Default audio stream set to eng ac3 6 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
Reading subtitle streams.
Subtitle detected for stream 2 - subrip eng.
Stream 2 is text-based subtitle for codec subrip.
Scanned for external subtitles and found 0 results in your approved languages.
Final sorting:
[]
cuda hwaccel is supported by this ffmpeg build and will be used [hwaccels].
Output Data
{
"source": [
"/data/Atlanta S04E04.mkv"
],
"format": "mp4",
"video": {
"codec": "h264_nvenc",
"map": 0,
"bitrate": 2800,
"crf": -1,
"maxrate": null,
"bufsize": null,
"level": 0.0,
"profile": null,
"preset": null,
"pix_fmt": null,
"field_order": "progressive",
"width": null,
"filter": null,
"params": null,
"framedata": null,
"bsf": null,
"debug": "video.max-bitrate",
"title": "HD"
},
"audio": [
{
"map": 1,
"codec": "ac3",
"channels": 6,
"bitrate": 768,
"profile": null,
"quality": 0,
"filter": null,
"samplerate": null,
"sampleformat": "",
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"bsf": null,
"debug": "audio",
"title": "5.1 Channel"
},
{
"map": 1,
"codec": "aac",
"channels": 2,
"bitrate": 256,
"quality": 0,
"profile": null,
"samplerate": null,
"sampleformat": "",
"filter": "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE",
"language": "eng",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"debug": "universal-audio",
"title": "Stereo"
}
],
"subtitle": [],
"attachment": []
}
Preopts
[
"-init_hw_device",
"cuda=sma:0",
"-hwaccel_device",
"sma",
"-hwaccel",
"cuda",
"-hwaccel_output_format",
"cuda"
]
Postopts
[
"-threads",
"0",
"-metadata:g",
"encoding_tool=SMA",
"\"-extra_hw_frames10\""
]
Subtitle Extracts
[]
Starting conversion.
FFmpeg command:
======================
/usr/local/bin/ffmpeg -init_hw_device cuda=sma:0 -hwaccel_device sma -hwaccel cuda -hwaccel_output_format cuda -i "/data/Atlanta S04E04.mkv" -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2800k -metadata:s:v BPS=2800000 -metadata:s:v BPS-eng=2800000 -metadata:s:v title=HD -metadata:s:v handler_name=HD -tag:v avc1 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:1 -ac:a:1 2 -b:a:1 256k -metadata:s:a:1 BPS=256000 -metadata:s:a:1 BPS-eng=256000 -filter:a:1 "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE" -metadata:s:a:1 title=Stereo -metadata:s:a:1 handler_name=Stereo -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA "-extra_hw_frames10" -y "/data/Atlanta S04E04.mp4"
======================
[ ] 0% Error converting file, FFMPEG error.
Traceback (most recent call last):
File "/opt/sma/resources/mediaprocessor.py", line 2276, in convert
for timecode, debug in conv:
File "/opt/sma/converter/__init__.py", line 329, in convert
for timecode, debug in self.ffmpeg.convert(outfile,
File "/opt/sma/converter/ffmpeg.py", line 760, in convert
raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
/usr/local/bin/ffmpeg -init_hw_device cuda=sma:0 -hwaccel_device sma -hwaccel cuda -hwaccel_output_format cuda -i /data/Atlanta S04E04.mkv -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2800k -metadata:s:v BPS=2800000 -metadata:s:v BPS-eng=2800000 -metadata:s:v title=HD -metadata:s:v handler_name=HD -tag:v avc1 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 title=5.1 Channel -metadata:s:a:0 handler_name=5.1 Channel -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:1 -ac:a:1 2 -b:a:1 256k -metadata:s:a:1 BPS=256000 -metadata:s:a:1 BPS-eng=256000 -filter:a:1 pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE -metadata:s:a:1 title=Stereo -metadata:s:a:1 handler_name=Stereo -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA "-extra_hw_frames10" -y /data/Atlanta S04E04.mp4
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-cuda --enable-cuvid --enable-fontconfig --enable-gpl --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libfdk_aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libnpp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libsrt --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzmq --enable-nonfree --enable-nvenc --enable-openssl --enable-parser=acc --enable-parser=h264 --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags='-I/install/include -I/install/include/ffnvcodec -I/usr/local/cuda/include/' --extra-ldflags='-L/install/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/' --extra-libs=-ldl --extra-libs=-lpthread --prefix=/install
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, matroska,webm, from '/data/Atlanta S04E04.mkv':
Metadata:
COMPATIBLE_BRANDS: dashiso6
MAJOR_BRAND : dash
MINOR_VERSION : 0
ENCODER : Lavf59.16.100
Duration: 00:26:26.20, start: 0.024000, bitrate: 6293 kb/s
Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
HANDLER_NAME : USP Video Handler
VENDOR_ID : [0][0][0][0]
ENCODER : AVC Coding
BPS : 5655204
DURATION : 00:26:25.209000000
NUMBER_OF_FRAMES: 38004
NUMBER_OF_BYTES : 1120585182
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
HANDLER_NAME : USP Sound Handler
VENDOR_ID : [0][0][0][0]
BPS : 640000
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English
BPS : 79
DURATION : 00:26:17.576000000
NUMBER_OF_FRAMES: 535
NUMBER_OF_BYTES : 15760
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (eac3 (native) -> ac3 (native))
Stream #0:1 -> #0:2 (eac3 (native) -> aac (native))
Stream #0:0 -> #1:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #1:1 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x55b4ffd789c0] Using a PCE to encode channel layout "5.1(side)"
Output #0, mp4, to '"-extra_hw_frames10"':
Metadata:
COMPATIBLE_BRANDS: dashiso6
MAJOR_BRAND : dash
MINOR_VERSION : 0
encoding_tool : SMA
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), cuda(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2800 kb/s, 23.98 fps, 24k tbn (default)
Metadata:
title : HD
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
DURATION : 00:26:25.209000000
NUMBER_OF_FRAMES: 38004
NUMBER_OF_BYTES : 1120585182
BPS : 2800000
BPS-eng : 2800000
handler_name : HD
encoder : Lavc59.37.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2800000 buffer size: 5600000 vbv_delay: N/A
Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
handler_name : 5.1 Channel
title : 5.1 Channel
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
BPS : 768000
BPS-eng : 768000
encoder : Lavc59.37.100 ac3
Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : Stereo
title : Stereo
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
BPS : 256000
BPS-eng : 256000
encoder : Lavc59.37.100 aac
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[aac @ 0x55b4ffd743c0] Qavg: 3153.184
[aac @ 0x55b4ffd743c0] 2 frames left in the queue on closing
[aac @ 0x55b4ffd789c0] Qavg: 144.233
[aac @ 0x55b4ffd789c0] 2 frames left in the queue on closing
Conversion failed!
/data/Atlanta S04E04.mp4 deleted.
There was an error processing file /data/Atlanta S04E04.mkv, no output data received
For some reason it removes the space, even when sticking it in quotes. I belive the order also does matter, because when I manually ran it (adding a space and moving the flag to after -hwaccel_output_format
), it did run:
/usr/local/bin/ffmpeg -init_hw_device cuda=sma:0 -hwaccel_device sma -hwaccel cuda -hwaccel_output_forma
t cuda -extra_hw_frames 10 -i "/data/Atlanta S04E04.mkv" -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2800k -metadata:s:v BPS=2800000 -metadata:s:v BPS-eng=2800000 -metadata:s:v title=HD -metadata:s:v handler_name=HD -tag:v avc1 -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:1 -ac:a:1 2 -b:a:1 256k -metadata:s:a:1 BPS=256000 -metadata:s:a:1 BPS-eng=256000 -filter:a:1 "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE" -metadata:s:a:1 title=Stereo -metadata:s:a:1 handler_name=Stereo -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/data/Atlanta S04E04.mp4"
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-cuda --enable-cuvid --enable-fontconfig --enable-gpl --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libfdk_aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libnpp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libsrt --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-libzmq --enable-nonfree --enable-nvenc --enable-openssl --enable-parser=acc --enable-parser=h264 --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags='-I/install/include -I/install/include/ffnvcodec -I/usr/local/cuda/include/' --extra-ldflags='-L/install/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/' --extra-libs=-ldl --extra-libs=-lpthread --prefix=/install
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, matroska,webm, from '/data/Atlanta S04E04.mkv':
Metadata:
COMPATIBLE_BRANDS: dashiso6
MAJOR_BRAND : dash
MINOR_VERSION : 0
ENCODER : Lavf59.16.100
Duration: 00:26:26.20, start: 0.024000, bitrate: 6293 kb/s
Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
HANDLER_NAME : USP Video Handler
VENDOR_ID : [0][0][0][0]
ENCODER : AVC Coding
BPS : 5655204
DURATION : 00:26:25.209000000
NUMBER_OF_FRAMES: 38004
NUMBER_OF_BYTES : 1120585182
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
HANDLER_NAME : USP Sound Handler
VENDOR_ID : [0][0][0][0]
BPS : 640000
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English
BPS : 79
DURATION : 00:26:17.576000000
NUMBER_OF_FRAMES: 535
NUMBER_OF_BYTES : 15760
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (eac3 (native) -> ac3 (native))
Stream #0:1 -> #0:2 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0x56151720e180] decoder->cvdl->cuvidCreateDecoder(&decoder->decoder, params) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
[h264 @ 0x56151720e180] Using more than 32 (34) decode surfaces might cause nvdec to fail.
[h264 @ 0x56151720e180] Try lowering the amount of threads. Using 13 right now.
[h264 @ 0x56151720e180] Failed setup for format cuda: hwaccel initialisation returned error.
Output #0, mp4, to '/data/Atlanta S04E04.mp4':
Metadata:
COMPATIBLE_BRANDS: dashiso6
MAJOR_BRAND : dash
MINOR_VERSION : 0
encoding_tool : SMA
encoder : Lavf59.27.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2800 kb/s, 23.98 fps, 24k tbn (default)
Metadata:
title : HD
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
DURATION : 00:26:25.209000000
NUMBER_OF_FRAMES: 38004
NUMBER_OF_BYTES : 1120585182
BPS : 2800000
BPS-eng : 2800000
handler_name : HD
encoder : Lavc59.37.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2800000 buffer size: 5600000 vbv_delay: N/A
Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
handler_name : 5.1 Channel
title : 5.1 Channel
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
BPS : 768000
BPS-eng : 768000
encoder : Lavc59.37.100 ac3
Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s
Metadata:
handler_name : Stereo
title : Stereo
VENDOR_ID : [0][0][0][0]
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:26:25.984000000
NUMBER_OF_FRAMES: 49562
NUMBER_OF_BYTES : 126878720
_STATISTICS_WRITING_APP: mkvmerge v67.0.0 ('Under Stars') 64-bit
BPS : 256000
BPS-eng : 256000
encoder : Lavc59.37.100 aac
frame=38031 fps=417 q=15.0 Lsize= 697149kB time=00:26:26.04 bitrate=3600.8kbits/s dup=27 drop=0 speed=17.4x
video:523161kB audio:172529kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.209721%
[aac @ 0x56151718cb80] Qavg: 14371.201
Didn't forget about you, was just out of town for a bit
The formatting for post-opts is a CSV so you need to enter it like
postopts = -extra_hw_frames, 10
No quotes needed
This is just how python passes parameters to executables
See if that adjustment lets it work or if you still need to move the position for it work
Additionally, if post-opts doesn't work try the preopts
options to move it earlier in the command and see if that works
I have save error.
Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed!
And when trying to use VAAPI I get hevc_vaapi Driver does not advertise encoder features, using guessed defaults. hevc_vaapi Driver does not advertise encoder block size, using guessed defaults. CPU can support HEVC MAIN 10 encode and decode, the only thing sI've done is upgrade the server and OS to 22.04, I still use the same SSD as before.
@VampiricAlien
Lots of problems with quicksync and ubuntu 22.02 that require very specific combination of drivers/support packages/ffmpeg versions especially for HEVC, there's like multiple full threads on the plex forums about trying to figure out which combinations actually work and it seems to vary between processor generations as well
This is ultimately an FFMPEG problem not a script problem
And as before, if you can produce an FFMPEG command that works (especially with hardware acceleration) please share it and I will find a way to replicate that within SMA or guide you to which existing options you need to change but I you'll need to sort that out on your own machine/hardware first
@VampiricAlien I wasn't aware of that, thanks for the info. I'll do some research and hopefully get back to you.
I don't want to hijack this issue but....
/usr/bin/ffmpeg -fix_sub_duration -init_hw_device vaapi=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel vaapi -hwaccel_output_format vaapi -i /home/file.mkv.original -vcodec hevc_vaapi -map 0:0 -field_order progressive -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -preset fast -profile:v main -level 5.1 -x265-params colorprim=bt709:transfer=bt709:colormatrix=bt709 -tag:v hvc1 -qp 0 -filter_hw_device sma -vf "format=nv12|vaapi,hwupload" -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 256k -metadata:s:a:0 BPS=256000 -metadata:s:a:0 BPS-eng=256000 -filter:a:0 "pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR" -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 copy -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f matroska -threads 0 -metadata:g encoding_tool=SMA -y /home/file.mkv
I removed settings from video and hdr [Video] codec = h265vaapi, h265, h264, x264, h264vaapi max-bitrate = 3500 max-width = 0 bitrate-ratio = 0.8 preopts = -extra_hw_frames, 10 crf = -0 crf-profiles = preset = fast codec-parameters = dynamic-parameters = True profile = main max-level = 5.1 pix-fmt = prioritize-source-pix-fmt = True filter = force-filter = False
What settings did you remove?
Edit: and can you post the full log?
VIDEO pix-fmt = p010le, nv12, yuv420p, yuv420p10le crf-profiles = 0:23:5M:15M,4000:23:10M:24M,8000:23:20M:60M
HDR pix-fmt = yuv420p10le
It's the pix-fmt option in the video settings that the issue, will not work with the options. Did you still want the logs?
@mdhiggins this command much use to you "format=nv12|vaapi,hwupload"
Got it, I guess whatever pix fmt it was trying to use isn't supported by VAAPI currently
I would make sure you're still getting HDR with your changes since that's where a lot of the known 22.02 issues reside (HDR and tone mapping specifically) and it may be changing the pix-fmt to something nonHDR
I give it 4 options to choose from and it didn't like it but picks nv12 if no option, very strange. I won't be able to test HDR until there is something new, I have some files going thru the script now.
def _codec_specific_produce_ffmpeg_list(self, safe, stream=0):
optlist = super(H264VAAPICodec, self)._codec_specific_produce_ffmpeg_list(safe, stream)
if 'qp' in safe:
optlist.extend(['-qp', str(safe['qp'])])
if 'maxrate' in safe:
optlist.extend(['-maxrate:v', str(safe['maxrate'])])
if 'bufsize' in safe:
optlist.extend(['-bufsize', str(safe['bufsize'])])
if 'device' in safe:
optlist.extend(['-filter_hw_device', safe['device']])
if 'decode_device' in safe and safe['decode_device'] != safe['device']:
optlist.extend(['-vf', 'hwdownload'])
else:
optlist.extend(['-vaapi_device', '/dev/dri/renderD128'])
if 'decode_device' in safe:
optlist.extend(['-vf', 'hwdownload'])
fmt = safe['vaapi_pix_fmt'] if 'vaapi_pix_fmt' in safe else self.default_fmt
fmtstr = ':format=%s' % safe['vaapi_pix_fmt'] if 'vaapi_pix_fmt' in safe else ""
if 'vaapi_wscale' in safe and 'vaapi_hscale' in safe:
optlist.extend(['-vf', 'format=%s|vaapi,hwupload,%s=w=%s:h=%s%s' % (fmt, self.scale_filter, safe['vaapi_wscale'], safe['vaapi_hscale'], fmtstr)])
elif 'vaapi_wscale' in safe:
optlist.extend(['-vf', 'format=%s|vaapi,hwupload,%s=w=%s:h=trunc(ow/a/2)*2%s' % (fmt, self.scale_filter, safe['vaapi_wscale'], fmtstr)])
elif 'vaapi_hscale' in safe:
optlist.extend(['-vf', 'format=%s|vaapi,hwupload,%s=w=trunc((oh*a)/2)*2:h=%s%s' % (fmt, self.scale_filter, safe['vaapi_hscale'], fmtstr)])
else:
fmtstr = ",%s=%s" % (self.scale_filter, fmtstr[1:]) if fmtstr else ""
optlist.extend(['-vf', "format=%s|vaapi,hwupload%s" % (fmt, fmtstr)])
return optlist
This is the relavent code where that decision is made based on the pix_fmt (from avcodecs.py)
fmtstr = ",%s=%s" % (self.scale_filter, fmtstr[1:]) if fmtstr else "" optlist.extend(['-vf', "format=%s|vaapi,hwupload%s" % (fmt, fmtstr)])
It's already here, was thinking FFmpeg added it, My research has turned up that adding -"format=nv12|vaapi,hwupload"
to the FFmpeg command would make VAAPI work.
nv12 pairs better with HEVC main?
Will just ask here, saves opening up a new issue, is there an option to add audio track title? I have 2 tracks 1) 5.1 2) stereo 2.0, they both show as Stereo.
nv12 is the default format so if you leave pix_fmt blank you'll get that parameter
And the titles are automatically calculated unless you have that feature disabled in autoProcess and it should be based on the number of channels, if a stream is being mislabeled please share the logs
Any idea best format to use or stick with nv12?
I would just stick with nv12 if you're looking to have the safest hardware accelerated stream
For now I'm grateful it's working and saving me a lot of space!!
Thanks, you're a real hero!
Describe the bug I am trying to use hardware acceleration in this script, but when converting, some files, I get several errors in a row and the conversion fails:
Command or context you are trying to run /opt/sma/manual.py -i "/data/Atlanta S04E04.mp4" -a -c /opt/sma/autoProcess.ini
autoProcess.ini settings
Log files Include log files for the specific job (not just a dump of all your logs for the past month) that's causing the issue. Please turn on debug level logging Log files are found in your script root config folder
./sma/config/sma.log
FFMpeg headers
System Information
Expected behavior The conversion should complete without failing
Additional context This issue does not happen when using the default autoProcess.ini. Its when I try and get it to use hardware acceleration when it seems to fail