Danke Selur, das hilft mir schon mal weiter.
Posts by GGRUB
-
-
Hallo,
UHD/4K war bisher immer noch kein Thema für mich. Seit ich aber einen Samsung Smart TV besitze interessiert es mich ein wenig.
Das liegt auch daran das mein Samsung-TV die Farben bei UHD-Blurays und/oder 4K Videos (USB-Stick) vom UHD-Player, scheinbar öfters falsch wiedergibt. Entweder das Bild ist viel zu hell und/oder die Farben viel zu stark ausgeprägt. Das sieht nicht schön aus. Aber ich brauche erst mal ein paar grundlegende Infos.
Haben UHD-Blu-Rays grundsätzlich HDR, 10 bit und YUV 4:2:0 ? Bei meinen wenigen UHD-Blu-Rays ist das nämlich so.
Auf dieser Seite "https://4kmedia.org/" kann man sich eine Menge HDR-UHD-Demos anschauen/runterladen.
Dabei ist mir mit MediaInfo aufgefallen das z.B. "die Mastering display luminance" nicht gleich ist. Also unterscheiden sich die Demos in dieser Hinsicht ja.
Mastering display luminance : min: 0.0500 cd/m2, max: 1200 cd/m2
Mastering display luminance : min: 0.0500 cd/m2, max: 1000 cd/m2
Ich habe vor mir von einigen Demos einen UHD-Blu-Ray Sampler anzufertigen. Da die Videos unterscheidliche Frameraten haben und ich konform bleiben möchte, muß encodet werden. Das soll mit ffmpeg/xlib265 passieren.
Es geht mir dabei erst mal gar nicht um die Bitraten, sondern um die Farbgenauigkeit. Wie kann man denn das HDR beibehalten beim Encoden ?
Ist das so richtig ?
ffmpeg -i input-HDR-UHD.ts -c:v libx265 -crf 22 -pix_fmt yuv420p10le -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc" -c:a copy output.mkv
Und dann lese ich öfters was von level=5.2/5.1/5.0 Muß das auch beachtet werden ?
-tag:v hvc1 ?
Und dann sind im Netz 4K-Videos zu finden die nur eine "Bit depth" von 8bit haben und kein HDR. Ist das konform ? Wie müßte man denn so ein Video encoden in Bezug auf die Farbwiedergabe ?
Und dann gibt es ja noch diese Streaming-Portale (Netfilx, Rakuten.TV usw) die auch mit UHD/4K werben. Senden Die HDR-UHD-10bit ?
Kann ich mir gar nicht vorstellen. Ich frage mich ob mein Smart-TV diese Videos in Helligkeit und Farbe richtig darstellen würde.
Es würde mich sehr freuen wenn jemand kurz einige aufklärende Infos geben würde. Ein "link" (Englisch ist aber leider nicht meine Stärke) würde mir auch reichen.
Gruß GGrub
EDIT:
QuoteDer UHD Premium-Standard kombiniert 4K-Auflösung mit Minimalansprüchen an Farbtiefe und Dynamikumfang.
3840×2160 Pixel in der Auflösung
10-Bit Farbtiefe
Wide-gamut RGB-Farbraum
Farbwiedergabe "BT.2020"
Darstellung von mehr als 90 Prozent des P3-Farbumfangs
High Dynamic Range-Unterstützung
Sehr hohes Verhältnis zwischen hellstem Weißton und dunkelstem Schwarzton
Als Beispiel hab ich das gefunden:
Codeffmpeg -i 'Ultra-HD_HDR.mp4' -pix_fmt yuv420p10le -profile:v main10 -c:v libx265 -crf 21 -preset veryslow -x265-params 'no-strong-intra-smoothing=1:no-sao=1:deblock=-2\:-2:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:range=limited:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50):max-cll=1200,0.0200' -an vslow_crf21.mp4
Infos warum da 'no-strong-intra-smoothing=1:no-sao=1 verwendet wurden und master-display=..., waren nicht beschrieben.
-
So, das hier isses für mich:
Codeffmpeg -i "pcm6.wav" -af pan="5.1| c0=c0 | c1=c1 | c2=c3 | c3=c2 | c4=c4 | c5=c5" -c:a ac3 -ac 2 -b:a 256k -af pan='stereo|FL=0.25*FL+FC+0.6*LFE|FR=0.25*FR+FC+0.6*LFE',"compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0" -y wav-st.ac3
Das Channelmapping verwende ich nur wegen eines Capture-Bugs, muß normalerweise nicht sein. Die Dynamikkomprimierung "compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0" stammt aus der ffmpeg-Doku. Ob man nun "dynaudnorm" auch noch braucht muß man testen. Sieht hier aber nicht so aus.
ich habe fertig
-
Ok, so funktioniert es:
Codeffmpeg -i "pcm6.wav" -map_channel 0.0.0 -map_channel 0.0.1 -map_channel 0.0.3 -map_channel 0.0.2 -map_channel 0.0.4 -map_channel 0.0.5 -c:a ac3 -ac 2 -b:a 256k -af pan='stereo|FL=0.25*FL+FC+0.6*LFE|FR=0.25*FR+FC+0.6*LFE',dynaudnorm -y wav-st.ac3
Aber die Dynamikkomprimierung ist suboptimal, und der Stereo-Effekt ist auch nicht überragend. Das kann Hybrid/sox deutlich besser.
ffmpeg unterstützt ja auch den "SoX Resampler"
Quote‘soxr’
select the SoX Resampler (where available); compensation, and filter optionsfilter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are notapplicable in this case.
Aber ob ich Lust habe mich damit auch noch zu beschäftigen weiß ich noch nicht. Das artet ja langsam in eine Wissenschaft aus.
Schade das die ffmpeg-Doku stellenweise so miserabel ist.
-
Hi Selur,
Das Capturedevice liefert mir den 6 Kanal PCM mit vertauschten LFE und CENTER. Wenn ich so einen Downmix mache kommt Müll dabei raus. Ich muß den channel 3 nach 2 und channel 2 nach 3 switchen. Und dann erst den Downmix machen. Oder beim Downmix den Switch direkt angeben.
Man kann es sehr gut in Audacity erkennen weil ich Capturefile (6 Kanal PCM) und Original (5.1 AC3) vergleichen kann. Oder ich hab hier ein grundlegendes Verständnisproblem.
-
Hallo,
Ich habe hier Capturevideos mit 6 Kanal Audio (1x Audiospur / 6 Kanäle).
Laut dieser Info ist das 5.1 channel-layout so festgelegt:
Im Capturevideo sieht das channel-layout allerdings so aus:
Da ist also beim "audiodecoding" während des Captures irgendwas schiefgelaufen. Wie auch immer ...
So sieht normalerweise meine ffmpeg Kommandozeile aus:
Codeffmpeg -i video_pcm_51 -c:v copy -c:a ac3 -b:a 320k -ac 2 -af pan='stereo|FL=0.25*FL+FC+0.6*LFE|FR=0.25*FR+FC+0.6*LFE' -y video_stereo.mkv
Resultat sollte ein 5.1 Downmix nach Stereo mit Dynamikkomprimierung sein, damit Sprache, Geräusche und Musik auf ähnlichem Level sind. Das kann also schon mal nicht klappen weil ich ein "channelmapping" FC<-->LFE brauche. Kanal 3+4 müssen somit vertauscht werden. Hat da jemand einen Tip für mich wie das funktioniert ?
Ich habe mich damit beholfen einfach im Code FC / LFE zu tauschen. Sieht dann also so aus:
Codeffmpeg -i video_pcm_51 -c:v copy -c:a ac3 -b:a 320k -ac 2 -af pan='stereo|FL=0.25*FL+LFE+0.6*FC|FR=0.25*FR+LFE+0.6*FC' -y video_stereo.mkv
Klar, funktioniert ... gefällt mir aber nicht. In der ffmpeg-Doku ist zu lesen das man das channelmapping mit -'channelmap=0|1|3|2|4|5:5.1' hinbekommt. Ich schaffe es aber nicht diesen code in die o.g. Kommandozeile einzubauen. Vielleicht kann mir jemand dabei helfen.
Bin mir auch nicht sicher ob der og. Code für einen "5.1 Downmix nach stereo" inkl. Dynamkkomprimierung optimal ist. Es gibt ja auch vorgefertigte Profile wie "dplii" dafür. vielleicht liest hier ein Wissender mit und kann mir einen Schubs geben.
Gruß ggrub
-
Hab jetzt mal den "intel-media-driver" getestet.
Codeffmpeg -hide_banner -threads 8 -vaapi_device /dev/dri/renderD128 -i h264_lossless.mkv -vf 'format=nv12,hwupload' -c:v h264_vaapi -pix_fmt vaapi_vld -b:v 10M -profile:v high -level 41 -quality 1 -bf 3 -y output.mkv ffmpeg -hide_banner -threads 8 -init_hw_device vaapi=intel:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device intel -i mjpeg-420.avi -vf 'format=nv12|vaapi,hwupload' -c:v h264_vaapi -pix_fmt vaapi_vld -b:v 10M -profile:v high -level 41 -quality 1 -bf 3 -y /t00.mkv ffmpeg -hide_banner -threads 8 -init_hw_device vaapi=intel:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device intel -i mjpeg-422.avi -vf 'format=nv12|vaapi,hwupload' -c:v mjpeg_vaapi -pix_fmt vaapi_vld -y output.avi
FUNKTIONIERT. Ist erheblich flexibler als der reine "libva-intel-driver". Nur so als Info.
-
So, hab noch ein paar Tests gemacht.
Das vom Capture-Device vorgegebene mjpeg_yuvj422p (lossless) avi läßt sich nicht transcoden (mjpeg_vaapi).
Das von ffmpeg erzeugte mjpeg_yuvj422p läßt sich ebenfalls nicht transcoden (mjpeg_vaapi).
Das von ffmpeg erzeugte mjpeg_yuvj420p läßt sich transoden (mjpeg_vaapi). Enorm hohe Performance.
Das von ffmpeg erzeugte mjpeg_yuvj420p läßt sich NICHT transoden (h264_vaapi).Fazit: Mit yuvj422p kann vaapi grundsätzlich nix anfangen im Bereich Trancoding. Transcoding von YUVJ420p nach YUV420P ist auch nicht möglich.
Vaaapi ist verdammt unflexibel muß ich feststellen. So jetzt is aber Ende. -
Ok, dann hab ich das falsch verstanden. Das Material (mjpeg) ist Scan type : Progressive. Das wirft jetzt die Frage auf ob "Hwaccel" interlaced Material erwartet. Darüber konnte ich nix erfahren.
Macht aber nix, weil ich ja jeden ffmpeg-codec verwenden kann, in welcher Form auch immer. Wenn also der "mjpeg-output" interlaced sein muß, kann man das sicher mit ffmpeg Settings beeinflussen.
Wenn der mjpeg-output proprietär ist, dann kann ich halt den ffmpeg mjpeg-codec verwenden. Irgendwas in dieser Richtung: "-c:v mjpeg -qmin 1 -q:v 1". Muß ich mal schauen was da in Richtung lossless möglich ist. -
CRF 6-12 geht nur mit Interlaced-Modus ? Das wußte ich auch noch nicht.
Das wurde mir zugetragen:
Quote
vaapi decode for mjpeg is enabled in this package. It's not viewed with ffmpeg -codecs or -decoders options. vaapi decoding is treated as a hwaccel component, and not as direct decoder, being used with ffmpeg option -hwaccel. You can see it enabled by viewing the ./configure output at build time: Enabled hwaccels: ... mjpeg_vaapi.
Bringt mich aber leider auch nicht weiter. Hwaccel Mjpeg-Decoding müßte also funktionieren, tut es aber (hier) nicht. Ich brauche halt das verlustlose Material zur Reproduktion im privaten Bereich, ist eine Vorgabe. -
???
Nein, mit 4:2:2 ist doch kein Transcoding möglich. Ich beende das jetzt auch hiermit.
Es ist aber sehr wohl möglich Hardware mjpeg-Decoding auszuführen: https://github.com/FFmpeg/FFmpeg/…37bd1af9c406241
Allerdings ist das wohl (noch) nicht mit reinkompiliert worden. Sieht man ja hier:
Codeffmpeg -codecs | grep vaapi DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid ) (encoders: mjpeg mjpeg_vaapi )
Also ist nur Encoding mit mjpeg_vaapi möglich.Gruß ggrub
-
Quote
Lossless ist mit 422 nicht standard konform
Ok, hab ich notiert. Bleibe ich also bei dem was die Capturekarte direkt zur Verfüung stellt: mjpeg yuvj422p.Code$ ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i mjpeg422.avi -vf 'format=yuv420p,hwupload' -c:v h264_vaapi -threads 8 -qp 18 -y output.mkvGuessed Channel Layout for Input Stream #0.1 : stereoInput #0, avi, from 'mjpeg422.avi': Duration: 00:01:00.60, start: 0.000000, bitrate: 49137 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 46824 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/sStream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi)) Stream #0:1 -> #0:1 (pcm_s24le (native) -> vorbis (libvorbis))Press [q] to stop, [?] for helpDuplicate formats in ff_merge_formats detected[swscaler @ 0x5655068339c0] deprecated pixel format used, make sure you did set range correctly[h264_vaapi @ 0x5655067e5300] Failed to end picture encode issue: 6 (invalid VASurfaceID).[h264_vaapi @ 0x5655067e5300] Encode failed: -5.Video encoding failedConversion failed!
Informationen was "hwupload" oder "hwaccel" überhaupt verarbeiten können sind spärlich zu finden und CPU-abhängig. Um das einigermaßen herauszufinden zeigt "vainfo" an:
Code$ vainfolibva info: VA-API version 1.1.0libva info: va_getDriverName() returns 0libva info: User requested driver 'i965'libva info: Trying to open /usr/lib/dri/i965_drv_video.solibva info: Found init function __vaDriverInit_1_1libva info: va_openDriver() returns 0vainfo: VA-API version: 1.1 (libva 2.1.0)vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.1.0vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileH264ConstrainedBaseline: VAEntrypointFEI VAProfileH264ConstrainedBaseline: VAEntrypointStats VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264Main : VAEntrypointFEI VAProfileH264Main : VAEntrypointStats VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointFEI VAProfileH264High : VAEntrypointStats VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointEncSlice VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice
Unterstützte Kodierungsformate werden mit VAEntrypointEncSlice angezeigt, und alle Dekodierungsformate werden mit VAEntryPointVLD- und VAEntrypointVideoProc angezeigt.
Wenn man nun davon ausgehen muß das "VAEntrypointEncPicture" ungleich "VAEntrypointEncSlice" ist, funktioniert das Transcoding nicht. Das erklärt aber nicht warum das Hardwaredecoding (VAEntryPointVLD) nicht funktioniert.
Code$ ffmpeg -hide_banner -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i mjpeg422.avi -f null -Guessed Channel Layout for Input Stream #0.1 : stereoInput #0, avi, from 'mjpeg422.avi': Duration: 00:01:00.60, start: 0.000000, bitrate: 49137 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 46824 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/sStream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (pcm_s24le (native) -> pcm_s16le (native))Press [q] to stop, [?] for helpffmpeg: gen8_mfd.c:2602: gen8_mfd_jpeg_bsd_object: Assertion `0' failed.Abgebrochen (Speicherabzug geschrieben)
Ok, dann muß ein anderer Weg her damit das Transcoding funktioniert. Voraussetzung ist nur das lossless Capture.
Man kann das Capture so konfigurieren das mit ffmpeg, 8bit YUV abgegriffen wird:Code
Display MoreFormat : YUV Codec ID : UYVY Codec ID/Info : Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32. Duration : 1 min 0 s Bit rate : 795 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:2 Compression mode : Lossless
ffmpeg greift also direct auf das Capturedevice zu.
Zum Encoden "on the fly" kann ich somit jeden internen ffmpeg-codec verwenden. Der muß halt lossless sein und anschließend für´s Transcoding taugen.Hat jemand eine Idee ?
-
Danke dir.
Ich hab mal testweise ein AVI mit libx264, lossless encodet um dieses 4:2:0 chroma subsampling zu erhalten (lossless ist Voraussetzung):
mediainfo:
CodeVideoID : 1Format : AVCFormat/Info : Advanced Video CodecFormat profile : High 4:4:4 Predictive@L4Format settings : 1 Ref FramesFormat settings, CABAC : NoFormat settings, ReFrames : 1 frameCodec ID : V_MPEG4/ISO/AVCDuration : 5 min 0 sBit rate : 133 Mb/sWidth : 1 920 pixelsHeight : 1 080 pixelsDisplay aspect ratio : 16:9Frame rate mode : ConstantFrame rate : 23.976 (24000/1001) FPSColor space : YUVChroma subsampling : 4:2:0Bit depth : 8 bitsScan type : ProgressiveBits/(Pixel*Frame) : 2.679Stream size : 4.66 GiB (98%)Writing library : x264 core 152 r2854 e9a5903Encoding settings : cabac=0 / ref=1 / deblock=0:0:0 / analyse=0:0 / me=dia / subme=0 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=23 / scenecut=0 / intra_refresh=0 / rc=cqp / mbtree=0 / qp=0Default : YesForced : No
Funktioniert auch nicht mit vaapi transcoding:
Code$ ffmpeg -hide_banner -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i 420ll.mkv -c:v h264_vaapi -b:v 10M -y output.mkvInput #0, matroska,webm, from '420ll.mkv': Metadata: ENCODER : Lavf58.12.100 Duration: 00:05:00.47, start: 0.000000, bitrate: 136154 kb/s Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv420p(progressive), 1920x1080, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default) Metadata: ENCODER : Lavc58.18.100 libx264 DURATION : 00:05:00.472000000 Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s (default) Metadata: ENCODER : Lavc58.18.100 ac3 DURATION : 00:05:00.416000000Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi)) Stream #0:1 -> #0:1 (ac3 (native) -> vorbis (libvorbis))Press [q] to stop, [?] for help[h264 @ 0x5575607b4980] Failed setup for format vaapi_vld: hwaccel initialisation returned error.Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'Error reinitializing filters!Failed to inject frame into filter network: Function not implementedError while processing the decoded data for stream #0:0[libvorbis @ 0x5575604a4fc0] 39 frames left in the queue on closingConversion failed!
Ich kann natürlich auf das Hardwaredecoding verzichten und folgendes ausführen:
Codeffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i 420ll.mkv -acodec copy -vf 'format=nv12,hwupload' -vcodec h264_vaapi -y -b:v 10M -profile:v high -level 41 -quality 1 -bf 3 -y output.mkv
Damit erreiche ich max. 4x speed. Das geht einigermaßen. Das erklärt aber auch nicht warum das Hardwaredecoding nicht funktioniert.Mit dem mjpeg-avi (yuvj422p) erreiche ich so erbämliche 1,7x speed.
Ich frage mich, warum ist das mjpeg-decoding unter Linux (arch) so unglaublich langsam ? Unter Windows erreiche ich mit dieser Datei erheblich bessere Performance.Ob das vielleicht ein ffmpeg Problem ist ? Weiß jemand wie man mit mencoder dieses 422-Avi nach 4:2:0 wandelt und an ffmpeg übergibt ? Diese piperei ist mir auch ein Buch mit sieben Siegeln. Muß ich mir mal bei Hybrid anschauen.
Gruß ggrub
-
Vielen Dank.
-
Mein Englisch ist miserabel. Aber vielleicht kannst du mir dabei helfen.
Und dann noch: You are not allowed to post or reply until you have been registered for at least 5 days.
Ich hab hier mal einen Beitrag erstellt um drüben einen Thread aufzumachen:
ffmpeg - vaapi
Hi,
my system:
CodeKernel: 4.16.11-1-ARCH Resolution: 2560x1440 Terminal: xfce4-terminal CPU: Intel i7-6700K (8) @ 4.200GHz GPU: Intel HD Graphics 530 GPU: NVIDIA GeForce GTX 750 Ti Memory: 31094MiB
Codevainfolibva info: VA-API version 1.1.0libva info: va_getDriverName() returns 0libva info: Trying to open /usr/lib/dri/i965_drv_video.solibva info: Found init function __vaDriverInit_1_1libva info: va_openDriver() returns 0vainfo: VA-API version: 1.1 (libva 2.1.0)vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.1.0vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileH264ConstrainedBaseline: VAEntrypointFEI VAProfileH264ConstrainedBaseline: VAEntrypointStats VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264Main : VAEntrypointFEI VAProfileH264Main : VAEntrypointStats VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointFEI VAProfileH264High : VAEntrypointStats VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointEncSlice VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice
Why is it not possible to decode this avi-file ?
https://drive.google.com/file/d/1PHjHzT…iew?usp=sharing
CodeGeneralComplete name : /media/a5_Lwork/va/test_01_.aviFormat : AVIFormat/Info : Audio Video InterleaveFile size : 30.6 MiBDuration : 4 s 120 msOverall bit rate : 62.3 Mb/sVideoID : 0Format : JPEGCodec ID : MJPGDuration : 4 s 120 msBit rate : 59.2 Mb/sWidth : 1 920 pixelsHeight : 1 080 pixelsDisplay aspect ratio : 16:9Frame rate : 25.000 FPSColor space : YUVChroma subsampling : 4:2:2Bit depth : 8 bitsScan type : ProgressiveCompression mode : LossyBits/(Pixel*Frame) : 1.142Stream size : 29.1 MiB (95%)AudioID : 1Format : PCMFormat profile : FloatCodec ID : 00000003-0000-0010-8000-00AA00389B71Codec ID/Hint : IEEE Duration : 4 s 120 msBit rate mode : ConstantBit rate : 3 072 kb/sChannel(s) : 2 channelsChannel positions : Front: L RSampling rate : 48.0 kHzBit depth : 32 bitsStream size : 1.51 MiB (5%)Alignment : Aligned on interleavesInterleave, duration : 45 ms (1.12 video frame)Interleave, preload duration : 500 ms
Code
Display More$ ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD129 -hwaccel_output_format vaapi -i test_01_.avi -f null - ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 8.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Input #0, avi, from 'test_01_.avi': Duration: 00:00:04.12, start: 0.000000, bitrate: 62304 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 59783 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0:1: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, stereo, flt, 3072 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (pcm_f32le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help ffmpeg: gen8_mfd.c:2602: gen8_mfd_jpeg_bsd_object: Assertion `0' failed. Abgebrochen (Speicherabzug geschrieben)
bye ggrub
Um jetzt nicht 5 Tage warten zu müssen kannst du diesen Beitrag gerne ins Doom9 Forum stellen.
-
Das Captureformat ist festgelegt auf mjpeg. Der Farbraum / Chroma subsampling ist ebenfalls nicht änderbar.
Ich hab einfach mal das yuvj422p Test-Avi mit libx264 crf 0 nach mp4 encodet (test_01.mp4), nur testweise. Die mp4-Datei hat immer noch yuvj422p. Aaaaber nun klappt es mit:
Codeffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i test_01.mp4 -f null -
Hilft mir zwar auch nix, aber das versteh wer will. ??? -
-
Hatte ich auch schon getestet und sollte eigentlich auch funktionieren. Es wird tatsächlich mit über 8x speed eine mp4-Datei erstellt. Es werden im Terminal keinerlei Fehler angezeigt.
Code
Display More$ ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i test_01.avi -vf 'scale_vaapi=format=nv12' -c:v h264_vaapi output.mp4 ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 8.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, avi, from 'test_01.avi': Duration: 00:02:49.48, start: 0.000000, bitrate: 43494 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 41181 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi)) Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mp4, to 'output.mp4': Metadata: encoder : Lavf58.12.100 Stream #0:0: Video: h264 (h264_vaapi) (High) (avc1 / 0x31637661), vaapi_vld(progressive), 1920x1080, q=0-31, 25 fps, 12800 tbn, 25 tbc Metadata: encoder : Lavc58.18.100 h264_vaapi Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (24 bit), 128 kb/s Metadata: encoder : Lavc58.18.100 aac frame= 4237 fps=207 q=-0.0 Lsize= 9235kB time=00:02:49.49 bitrate= 446.3kbits/s speed=8.26x video:6459kB audio:2659kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.282551% [aac @ 0x5617c5923900] Qavg: 184.927
Aaaaber .... es ist kein Bildinhalt vorhanden, nur abwechelnd ein grün/rosa Bildflackern.
Falls du Interesse hast das mal selbst zu testen, hier ein ganz kurzer yuvj422p-AVI-Schnipsel:
-
Und das ist der Grund: VAAPI-basierte Encoder können nur Eingaben aus VAAPI-Oberflächen annehmen.
Quote
Surface Formats
The hardware codecs used by VAAPI are not able to access frame data in arbitrary memory. Therefore, all frame data needs to be uploaded to hardware surfaces connected to the appropriate device before being used. All VAAPI hardware surfaces in ffmpeg are represented by the vaapi pixfmt.
Und der Farbraum ist scheinbar auf 4:2:0 festgetackert. Was für ein Nachteil !Um also einen Stream/Datei im yuvj422p (test_01.avi) Farbraum verarbeiten zu können, muß eine hwupload-Instanz vorangestellt werden um einen normalen Frame in einen Frame im Vaapi-Format zu konvertieren. Und DAS kostet gewaltig Performance.
Codeffmpeg -vaapi_device /dev/dri/renderD128 -i test_01.avi -vf 'format=yuvj422p,hwupload' -c:v h264_vaapi ... out.mp4
Da kriecht hier das Encoding mit max. 3x durch die Gegend. Die Hardwarefilter können auch nicht angewendet werden.Ist allerdings der Stream/Datei im yuv(j)420p Farbraum ...
Codeffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i test_01_420.avi -c:v h264_vaapi ... output.mp4
... ja dann geht die Post ab mit 10 fachen Speed. Aber was nützt das demjenigen der halt 442-avi's hat.Umwandeln nach yuvj420p oder yuv420p und nach ffmpeg pipen. Keine Ahnung ob die VAAPI-Oberfläche den Input dann verarbeiten kann.
Codevainfo: Supported profile and entrypoints VAProfileNone : VAEntrypointVideoProc VAProfileNone : VAEntrypointStats VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointFEI VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointFEI VAProfileH264High : VAEntrypointEncSliceLP VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointFEI VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointFEI
hat jemand einen Tipp ?
Ich kenne mich damit nicht aus.
Codeffmpeg -i test_01.avi -pix_fmt yuvj420p -f mjpeg -q 0 pipe:1 | ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD129 -hwaccel_output_format vaapi -i pipe:0 -c:v h264_vaapi -y output.mkv
Ist auch nicht das gelbe vom Ei. -
Ok, ich hab mal kurz VAAPI getestet. Funktioniert erst mal.
Code
Display More$ ffmpeg -vaapi_device /dev/dri/renderD128 -i test_01.avi -vf 'format=yuvj422p,hwupload' -c:v h264_vaapi -threads 8 -qp 18 output.mkv ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 8.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, avi, from 'test_01.avi': Duration: 00:02:49.48, start: 0.000000, bitrate: 43494 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 41181 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s File 'output.mkv' already exists. Overwrite ? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi)) Stream #0:1 -> #0:1 (pcm_s24le (native) -> vorbis (libvorbis)) Press [q] to stop, [?] for help [swscaler @ 0x55d766e983c0] deprecated pixel format used, make sure you did set range correctly Output #0, matroska, to 'output.mkv': Metadata: encoder : Lavf58.12.100 Stream #0:0: Video: h264 (h264_vaapi) (High) (H264 / 0x34363248), vaapi_vld(progressive), 1920x1080, q=0-31, 25 fps, 1k tbn, 25 tbc Metadata: encoder : Lavc58.18.100 h264_vaapi Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (24 bit) Metadata: encoder : Lavc58.18.100 libvorbis frame= 4237 fps= 74 q=-0.0 Lsize= 152555kB time=00:02:49.47 bitrate=7374.0kbits/s speed=2.95x video:150575kB audio:1879kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.066576%
Der speed=2.95x ist meilenweit von qsv entfernt. Wenn ich diese Datei in Hybrid (Windows 7) lade und mit qsvencc (qsv) encode geht da die Post ab.
Irgendwo klemmt es noch.