Uskon, että libx264 pystyy nyt tekemään 10-bittisiä 4: 2: 2-koodauksia, mutta En näytä saavan sitä toimimaan. Käytän ffmpeg-tiedostoa (alla olevat tiedot) ja olen kokeillut myös x264-kooderia suoraan. Olen kokeillut

ffmpeg.exe -i input.mov -c:v libx264 -profile:v high422 -crf 20 -pix_fmt yuv422p output.mp4 

ja se tuottaa mukavan 4: 2: 2-ulostulon, mutta vain 8-bittisellä syvyydellä,

[libx264 @ 00000000055a9de0] profile High 4:2:2, level 4.0, 4:2:2 8-bit 

ja olen kokeillut

ffmpeg.exe -i input.mov -c:v libx264 -profile:v high10 -crf 20 -pix_fmt yuv422p output.mp4 

ja se antaa minulle virheen:

x264 [error]: high10 profile doesn"t support 4:2:2 [libx264 @ 00000000051ead60] Error setting profile high10. [libx264 @ 00000000051ead60] Possible profiles: baseline main high high10 high422 high444 

x264 –fullhelp -dokumentaatiossa I etsi:

 --profile <string> Force the limits of an H.264 profile Overrides all settings. [...] - high10: No lossless. Support for bit depth 8-10. - high422: No lossless. Support for bit depth 8-10. Support for 4:2:0/4:2:2 chroma subsampling. - high444: Support for bit depth 8-10. Support for 4:2:0/4:2:2/4:4:4 chroma subsampling. 

Joten se voi tehdä 4: 2: 2 10 bitin syvyydessä ja jopa 4: 4: 4 10 bitillä ilmeisesti, mutta siellä ” s ei ole tietoa siitä, kuinka lähtöbitin syvyys asetetaan. On vaihtoehto --input-depth <integer> Specify input bit depth for raw input, mutta lähtöbittisyvyydelle ei ole mitään.

Kommentit

Vastaa

x264 tukee sekä 8-bittisiä että 10-bittisiä lähtöjä, eikä sinun tarvitse tehdä mitään erityistä.

ffmpeg

Jos käytät ffmpeg, näet, mitä pikselimuotoja ja bittisyvyyksiä libx264 tukee:

$ ffmpeg -h encoder=libx264 [...] Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le 

10-bittiset pikselimuodot ovat: yuv420p10le, yuv422p10le, yuv444p10le.

x264

Voit myös tarkistaa x264 tuetuille bittisyvyyksille:

$ x264 --help [...] Output bit depth: 8/10 

Aikaisemmin joudut kääntämään x264: n --bit-depth=10 ja linkitä sitten ffmpeg joko 8-bittiseen tai 10-bittiseen libx264: ään, mutta se on nyt tarpeetonta. Katso Yhdistä 8- ja 10-bittinen CLI ja kirjastot saadaksesi lisätietoja.

Kommentit

  • Hitto, mikä tekee asioista com plikoitu. Joten ’ tarvitsen kaksi ffmpeg-binaaria, jotka on linkitetty kahteen x264-kirjastoon. Tiedätkö, onko 10-bittisen x264: n staattisia koontiversioita missään?
  • Löydät ne täältä: download.videolan.org/pub/x264/binaries Jos haluat rakentaa sen itse, siellä on erittäin pitkä kierteinen prosessi, joka kehottaa asentamaan mingw-, yasm-, git- ja gcc-tiedostoja sekä paljon muuntamista täällä: doom10.org/ index.php? topic = 26.0 Mutta en voinut ’ saada sitä toimimaan lähinnä typerän yrityksen palomuurin takia, joka voitti ’ t salli git.
  • Ehkä voit saada Zeranoen tarjoamaan tällaisen koontiversion. Valitettavasti olen ’ melko hyödytön Windows-käyttöjärjestelmässä.
  • Olen niin, että ’ ongelma. Olen ’ lähettänyt koontipyynnön, ’ näemme, miten se menee.
  • FWIW näinä päivinä libx264 on ” molemmat ” uskon …

Vastaa

edit: Tein onnistuneesti 10-bittisen koodauksen ankkojen lentoonlähdöstä .

Ensimmäinen tapa: Rakensin 10-bittisen x264-binaarin, joka yhdistää staattisesti libx264: n.

cp -al x264-git x264-10bit # instead of changing my normal git checkout cd x264-10bit ./configure --extra-cflags=-march=native --enable-static --disable-interlaced --bit-depth=10 make -j2 sudo install x264 /usr/local/bin/x264-10bit mkfifo pipe.y4m ffmpeg -v verbose -i in -pix_fmt yuv420p10le -strict experimental -f yuv4mpegpipe pipe.y4m (open another shell window / tab / screen(1) window): x264 pipe.y4m --crf 30 --preset ultrafast -o 10bit-420.mkv 

(ultranopea ja heikkolaatuinen, koska se on todiste käsitteestä, ei laatutesti.) I ei kääntänyt sitä swscale-sovelluksella. (Se oli tyytymätön libavutilissa olevaan RGB pix fmt: hen tai vastaavaan). Se virheitä, jos syötetty väriavaruus ei vastaa --output-csp i444, mikä on todella mukavaa, jos et halua vahingossa x264: n alittaa kromaa. Se toimi hyvin, kun syötin siihen muutaman kehyksen yuv444p14le.y4m ja tuotin 10-bittistä lähtöä. (Se voi katkaista bittisyvyyden, mutta ei pienentää kromaa ilman swscale-arvoa.)

Toinen tapa: valitse 10-bittinen libx264.so

LD_LIBRARY_PATH p> Voit käyttää samaa dynaamisesti linkitettyä ffmpeg-binaaria kaikkeen.

cp -al x264-git x264-10bit # instead of changing my normal git checkout cd x264-10bit ./configure --extra-cflags=-march=native "--libdir=/usr/local/lib/high-bit-depth-codec" "--includedir=/usr/local/lib/high-bit-depth-codec/include" --disable-cli --enable-shared --disable-interlaced --bit-depth=10 make -j2 sudo make install-lib-shared # this Makefile target depends on install-lib-dev, hence setting --includedir alias highdepth-ffmpeg="LD_LIBRARY_PATH=/usr/local/lib/high-bit-depth-codec ffmpeg" highdepth-ffmpeg -v verbose -framerate 50 -f image2 \ -pattern_type glob -i ./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/"*".sgi \ -pix_fmt yuv420p10le -crf 30 -preset ultrafast \ -sws_flags +accurate_rnd+print_info \ with_ld_path.420p10.accurate_rnd.mkv ffmpeg version N-68044-gb9dd809 Copyright (c) 2000-2015 the FFmpeg developers built on Jan 14 2015 23:21:08 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-ffserver --enable-libbluray --enable-libschroedinger --enable-libtheora --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libopus --enable-libwebp --enable-libvpx --disable-outdev=oss --disable-indev=oss --disable-encoder=vorbis --enable-libvorbis --enable-libfdk-aac --disable-encoder=aac --disable-decoder=jpeg2000 --enable-libvidstab libavutil 54. 16.100 / 54. 16.100 libavcodec 56. 20.100 / 56. 20.100 libavformat 56. 18.101 / 56. 18.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 7.101 / 5. 7.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, image2, from "./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/*.sgi": Duration: 00:00:10.00, start: 0.000000, bitrate: N/A Stream #0:0: Video: sgi, rgb48be, 1280x720, 50 tbr, 50 tbn, 50 tbc [graph 0 input from stream 0:0 @ 0x1b6d8c0] w:1280 h:720 pixfmt:rgb48be tb:1/50 fr:50/1 sar:0/1 sws_param:flags=2 [auto-inserted scaler 0 @ 0x1b7dae0] w:iw h:ih flags:"0x41004" interl:0 [format @ 0x1b7e940] auto-inserting filter "auto-inserted scaler 0" between the filter "Parsed_null_0" and the filter "format" SwScaler: reducing / aligning filtersize 1 -> 4 Last message repeated 1 times SwScaler: reducing / aligning filtersize 1 -> 1 SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @ 0x1b500c0] bicubic scaler, from rgb48be to yuv420p10le using MMXEXT [swscaler @ 0x1b500c0] 1280x720 -> 1280x720 [auto-inserted scaler 0 @ 0x1b7dae0] w:1280 h:720 fmt:rgb48be sar:0/1 -> w:1280 h:720 fmt:yuv420p10le sar:0/1 flags:0x41004 [libx264 @ 0x1b78da0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle [libx264 @ 0x1b78da0] profile High 10, level 3.2, 4:2:0 10-bit [libx264 @ 0x1b78da0] 264 - core 144 r2525+2 6a4fca8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=30.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=0 Output #0, matroska, to "with_ld_path.420p10.accurate_rnd.mkv": Metadata: encoder : Lavf56.18.101 Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p10le, 1280x720, q=-1--1, 50 fps, 1k tbn, 50 tbc Metadata: encoder : Lavc56.20.100 libx264 Stream mapping: Stream #0:0 -> #0:0 (sgi (native) -> h264 (libx264)) Press [q] to stop, [?] for help No more output streams to write to, finishing.e=00:00:09.84 bitrate=12060.2kbits/s frame= 500 fps= 14 q=-1.0 Lsize= 14714kB time=00:00:10.00 bitrate=12053.5kbits/s video:14709kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.031423% Input file #0 (./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/*.sgi): Input stream #0:0 (video): 500 packets read (2765056000 bytes); 500 frames decoded; Total: 500 packets (2765056000 bytes) demuxed Output file #0 (with_ld_path.420p10.accurate_rnd.mkv): Output stream #0:0 (video): 500 frames encoded; 500 packets muxed (15062147 bytes); Total: 500 packets (15062147 bytes) muxed [libx264 @ 0x1b78da0] frame I:2 Avg QP:43.00 size:144760 [libx264 @ 0x1b78da0] frame P:498 Avg QP:49.83 size: 29663 [libx264 @ 0x1b78da0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0x1b78da0] mb P I16..4: 5.1% 0.0% 0.0% P16..4: 79.3% 0.0% 0.0% 0.0% 0.0% skip:15.6% [libx264 @ 0x1b78da0] coded y,uvDC,uvAC intra: 67.8% 60.5% 41.9% inter: 50.1% 16.3% 2.8% [libx264 @ 0x1b78da0] i16 v,h,dc,p: 5% 54% 33% 8% [libx264 @ 0x1b78da0] i8c dc,h,v,p: 53% 39% 6% 3% [libx264 @ 0x1b78da0] kb/s:12049.24 (same bitrate and stats as with the y4m pipe, so it behaves the same with the same input data... good.) 

En tietenkään yrittänyt nähdä mitään visuaalisesti näillä laatuasetuksilla. Halusin vain, että se toimisi nopeasti eikä tuhlaisi joukkoa levytilaa koska pääsen aina tekemään paljon tulostustiedostoja kokeellessani muunnelmia asioista.

Koska piippaamasta massiivista y4m-dataa erilliseen x264-prosessiin, se meni 14 kuvaa sekunnissa 12: n sijaan, joten kunnollinen nopeus ultranopealle. Hitaampi koodaus kääpiö tuo yleiskustannus.

Lähteeni on 48-bittinen RGB. Huomasin, että tarkka_rnd ei vaikuttanut lähtöön mkv. (Bittiseurannaiset tulokset ilman -sws_flags, joissa -sws_flags +accurate_rnd ja -vf scale=flags=accurate_rnd, lukuun ottamatta muutamaa bittiä mkv-otsikossa, luultavasti satunnaistettu mkv UUID. Jopa -qp 0, joten en menettänyt sitä pyöristysvirheestä. cmp -l f1 f2 | less vertaamaan binaaritiedostoja, jotka saattavat olla samat alkuvaiheen jälkeen.Tai ssdeep -p. Ehkä accurate_rnd on nyt oletusarvo?)

On merkitystä yhdellä ffmpeg swscaler -lipulla, jos annat ffmpegin alikopioida kromasi: lanczot oletusarvon sijaan bicubic. (Oletan, että lanczoja pidetään edelleen parhaana vaihtoehtona korkealaatuiselle laadulle? Haven ei lue aikaa.)

highdepth-ffmpeg -i in -pix_fmt yuv420p10le ...encode...opts...
-vf scale=flags=lanczos -sws_flags +accurate_rnd+print_info with_ld_path.420p10.accurate_rnd.lanczos.mkv

+lanczos: n lisääminen -sws_flags ei toimi:

[format @ 0x28e4940] auto-inserting filter "auto-inserted scaler 0" between the filter "Parsed_null_0" and the filter "format" [swscaler @ 0x28b60c0] Exactly one scaler algorithm must be chosen, got 204 [auto-inserted scaler 0 @ 0x28e3ae0] Failed to configure output pad on auto-inserted scaler 0 Error opening filters! 

Jos yrität syöttää sitä yli 10 bittistä syötettä, ffmpeg hylkää.

highdepth-ffmpeg ... -pix_fmt yuv444p14le [graph 0 input from stream 0:0 @ 0x36ec9c0] w:1280 h:720 pixfmt:rgb48be tb:1/50 fr:50/1 sar:0/1 sws_param:flags=2 Incompatible pixel format "yuv444p14le" for codec "libx264", auto-selecting format "yuv444p10le" [Parsed_scale_0 @ 0x36e2a00] w:1280 h:720 fmt:rgb48be sar:0/1 -> w:1280 h:720 fmt:yuv444p10le sar:0/1 flags:0x200 [libx264 @ 0x3701d80] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle [libx264 @ 0x3701d80] profile High 4:4:4 Predictive, level 3.2, 4:4:4 10-bit 

Itse asiassa ffmpegin libx264-ohjain vaatii aina syöttämään x264: n tarkalleen. bittisyvyys, johon se on koottu. esim. -pix_fmt yuv420p:

Incompatible pixel format "yuv420p" for codec "libx264", auto-selecting format "yuv420p10le" 

x264.h sanoo:

/* x264_bit_depth: * Specifies the number of bits per pixel that x264 uses. This is also the * bit depth that x264 encodes in. If this value is > 8, x264 will read * two bytes of input data for each pixel sample, and expect the upper * (16-x264_bit_depth) bits to be zero. * Note: The flag X264_CSP_HIGH_DEPTH must be used to specify the * colorspace depth as well. */ X264_API extern const int x264_bit_depth; 

Luulen, että sisäisesti x264: n (CLI) on aina muunnettava pikselimuodot, koodissa ei ole 8-bittistä tuloa, 10-bittisiä lähtöversioita jokaisesta toiminnosta . Ja mielestäni mielestäni erilaisten tulobittisyvyyksien hyväksyminen on vain x264-käyttöliittymässä, ei kirjaston sovellusliittymässä. Olen utelias, mitä tapahtuu, kun syötät API-syötettä siellä, missä on asetettu suurempia bittejä … (ffpeg ei salli sinun tehdä tätä hakkeroimatta koodia, joten tämän ei tarvitse olla kenenkään huolissaan välttämisestä.)

frame.c:370: So this is why ffmpeg can"t give 8-bit input to libx264 #if HIGH_BIT_DEPTH if( !(src->img.i_csp & X264_CSP_HIGH_DEPTH) ) { x264_log( h, X264_LOG_ERROR, "This build of x264 requires high depth input. Rebuild to support 8-bit input.\n" ); return -1; } #else 

Jos pix_fmt-arvoa ei ole määritetty, ffmpeg valitsee yuv444p10le, kun se annetaan rgb-syötteeksi. Tai libx264rgb, se syöttää 8-bittisen rgb: n toiminnoille, jotka odottavat 16-bittistä (joista 10 ovat merkittäviä), ja segmenttivirheille>. <. Minä ilmoitan, että ylävirtaan …

 highdepth-ffmpeg -v verbose -framerate 50 -f image2 -pattern_type glob -i ./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/"*".sgi -qp 0 -preset ultrafast -sws_flags print_info+accurate_rnd -frames 2 -c:v libx264rgb lossless.rgb.mkv ffmpeg version N-68044-gb9dd809 Copyright (c) 2000-2015 the FFmpeg developers built on Jan 14 2015 23:21:08 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-ffserver --enable-libbluray --enable-libschroedinger --enable-libtheora --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libopus --enable-libwebp --enable-libvpx --disable-outdev=oss --disable-indev=oss --disable-encoder=vorbis --enable-libvorbis --enable-libfdk-aac --disable-encoder=aac --disable-decoder=jpeg2000 --enable-libvidstab libavutil 54. 16.100 / 54. 16.100 libavcodec 56. 20.100 / 56. 20.100 libavformat 56. 18.101 / 56. 18.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 7.101 / 5. 7.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, image2, from "./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/*.sgi": Duration: 00:00:10.00, start: 0.000000, bitrate: N/A Stream #0:0: Video: sgi, rgb48be, 1280x720, 50 tbr, 50 tbn, 50 tbc [graph 0 input from stream 0:0 @ 0x1eb9660] w:1280 h:720 pixfmt:rgb48be tb:1/50 fr:50/1 sar:0/1 sws_param:flags=2 [auto-inserted scaler 0 @ 0x1eba120] w:iw h:ih flags:"0x41000" interl:0 [format @ 0x1eb94c0] auto-inserting filter "auto-inserted scaler 0" between the filter "Parsed_null_0" and the filter "format" SwScaler: reducing / aligning filtersize 1 -> 4 Last message repeated 1 times SwScaler: reducing / aligning filtersize 1 -> 1 Last message repeated 1 times [swscaler @ 0x1eba480] bicubic scaler, from rgb48be to rgb24 using MMXEXT [swscaler @ 0x1eba480] 1280x720 -> 1280x720 [auto-inserted scaler 0 @ 0x1eba120] w:1280 h:720 fmt:rgb48be sar:0/1 -> w:1280 h:720 fmt:rgb24 sar:0/1 flags:0x41000 No pixel format specified, rgb24 for H.264 encoding chosen. Use -pix_fmt yuv420p for compatibility with outdated media players. [libx264rgb @ 0x1ecf020] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle [libx264rgb @ 0x1ecf020] profile High 4:4:4 Predictive, level 3.2, 4:4:4 10-bit [libx264rgb @ 0x1ecf020] 264 - core 144 r2525+2 6a4fca8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: 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=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0 Output #0, matroska, to "lossless.rgb.mkv": Metadata: encoder : Lavf56.18.101 Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1280x720, q=-1--1, 50 fps, 1k tbn, 50 tbc Metadata: encoder : Lavc56.20.100 libx264rgb Stream mapping: Stream #0:0 -> #0:0 (sgi (native) -> h264 (libx264rgb)) Press [q] to stop, [?] for help No more output streams to write to, finishing. Segmentation fault (core dumped) 

Ilmoitan siitä ylävirtaan.

Joka tapauksessa kävi ilmi, että oli melko mukavaa rakentaa itseni kaksoisbittinen syvyysympäristö ffmpegille tai mille tahansa muulle ohjelmalle, jonka haluat ajaa libx264: n, libx265: n ja minkä tahansa muun haluamasi korkean bittisyvyyden kootuilla versioilla. (Siksi kutsuin sitä ”highdepth”, ei vain ”10-bittinen” lyhyemmälle nimelle.)

muokkauksen loppu: alla on hämmennyksiäni kääntämättä uudelleen. Ja hyvä asia siitä, kuinka ffmpeg käännetään Win64: lle ristiin

Yritin itse, koska et yrittänyt cmdline-rivillä, joka yritti syöttää suuren bittisyvyyden syötteen x264: lle.

ffmpeg-pikselimuodon nimet (ffmpeg -pix_fmts) älä määritä vain järjestelyä, ne yhdistyvät tarkkaan bittijärjestelyyn, ja siten jokaisella formaatti + bittisyvyys-yhdistelmällä on eri nimi. Luulen, että odotit -pix_fmt yuv422p tarkoittavan ”muunna 422: ksi samalla bittisyvyydellä kuin syötteeni”.

wikipedia sanoo, että h.264 tukee 8-14-bittistä syvyyttä vain Hi444PP: n kanssa, toiset ovat vain 10-bittisiä. Hi444PP on ainoa profiili, joka tukee ennakoivaa häviötöntä koodausta, jota x264 käyttää -qp 0 tai -crf 0. edit: AFAICT, x264 tukee edelleen vain kääntämistä 8, 9 tai 10 bitille.

Joka tapauksessa tässä on joukko hyödytöntä lähtöä komennosta, joka ei toimi, koska en kääntänyt paikallista uudelleen x264. (Mutta sen pitäisi toimia uudelleen käännetyn x264: n kanssa. Voin muokata tätä vastausta, jos haluan pelata itse.)

ffmpeg -v verbose -framerate 50 -f image2 -pattern_type glob -i ./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/"*".sgi -c:v libx264 -pix_fmt yuv420p10le -profile high10 yuv-high.mkv

ffmpeg version N-68044-gb9dd809 Copyright (c) 2000-2015 the FFmpeg developers built on Jan 14 2015 23:21:08 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-ffserver --enable-libbluray --enable-libschroedinger --enable-libtheora --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libopus --enable-libwebp --enable-libvpx --disable-outdev=oss --disable-indev=oss --disable-encoder=vorbis --enable-libvorbis --enable-libfdk-aac --disable-encoder=aac --disable-decoder=jpeg2000 --enable-libvidstab libavutil 54. 16.100 / 54. 16.100 libavcodec 56. 20.100 / 56. 20.100 libavformat 56. 18.101 / 56. 18.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 7.101 / 5. 7.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 Input #0, image2, from "./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/*.sgi": Duration: 00:00:10.00, start: 0.000000, bitrate: N/A Stream #0:0: Video: sgi, rgb48be, 1280x720, 50 tbr, 50 tbn, 50 tbc Please use -profile:a or -profile:v, -profile is ambiguous File "yuv-high.mkv" already exists. Overwrite ? [y/N] y [graph 0 input from stream 0:0 @ 0x24797e0] w:1280 h:720 pixfmt:rgb48be tb:1/50 fr:50/1 sar:0/1 sws_param:flags=2 Incompatible pixel format "yuv420p10le" for codec "libx264", auto-selecting format "yuv420p" [auto-inserted scaler 0 @ 0x24938c0] w:iw h:ih flags:"0x4" interl:0 [format @ 0x2494680] auto-inserting filter "auto-inserted scaler 0" between the filter "Parsed_null_0" and the filter "format" [auto-inserted scaler 0 @ 0x24938c0] w:1280 h:720 fmt:rgb48be sar:0/1 -> w:1280 h:720 fmt:yuv420p sar:0/1 flags:0x4 [libx264 @ 0x248eda0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle [libx264 @ 0x248eda0] profile High, level 3.2 [libx264 @ 0x248eda0] 264 - core 144 r2525+2 6a4fca8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, matroska, to "yuv-high.mkv": Metadata: encoder : Lavf56.18.101 Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1280x720, q=-1--1, 50 fps, 1k tbn, 50 tbc Metadata: encoder : Lavc56.20.100 libx264 Stream mapping: Stream #0:0 -> #0:0 (sgi (native) -> h264 (libx264)) Press [q] to stop, [?] for help No more output streams to write to, finishing.e=00:00:09.02 bitrate=18034.6kbits/s frame= 500 fps=6.6 q=-1.0 Lsize= 21568kB time=00:00:09.96 bitrate=17739.6kbits/s video:21564kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.020773% Input file #0 (./3_DucksTakeOff_720p50_CgrLevels_SINC_FILTER_SVTdec05_/*.sgi): Input stream #0:0 (video): 500 packets read (2765056000 bytes); 500 frames decoded; Total: 500 packets (2765056000 bytes) demuxed Output file #0 (yuv-high.mkv): Output stream #0:0 (video): 500 frames encoded; 500 packets muxed (22081186 bytes); Total: 500 packets (22081186 bytes) muxed [libx264 @ 0x248eda0] frame I:2 Avg QP:29.33 size:131874 [libx264 @ 0x248eda0] frame P:257 Avg QP:31.07 size: 75444 [libx264 @ 0x248eda0] frame B:241 Avg QP:33.54 size: 10073 [libx264 @ 0x248eda0] consecutive B-frames: 3.6% 96.4% 0.0% 0.0% [libx264 @ 0x248eda0] mb I I16..4: 0.1% 71.9% 28.0% [libx264 @ 0x248eda0] mb P I16..4: 0.0% 4.5% 1.1% P16..4: 36.1% 37.6% 19.6% 0.0% 0.0% skip: 1.0% [libx264 @ 0x248eda0] mb B I16..4: 0.0% 0.2% 0.1% B16..8: 34.3% 2.6% 1.1% direct: 9.6% skip:52.2% L0: 6.2% L1:46.6% BI:47.2% [libx264 @ 0x248eda0] 8x8 transform intra:78.4% inter:60.4% [libx264 @ 0x248eda0] coded y,uvDC,uvAC intra: 98.3% 95.3% 85.9% inter: 51.7% 34.8% 12.8% [libx264 @ 0x248eda0] i16 v,h,dc,p: 5% 77% 4% 14% [libx264 @ 0x248eda0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 2% 43% 11% 3% 5% 2% 16% 2% 16% [libx264 @ 0x248eda0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 3% 40% 9% 4% 6% 3% 17% 2% 16% [libx264 @ 0x248eda0] i8c dc,h,v,p: 47% 40% 6% 7% [libx264 @ 0x248eda0] Weighted P-Frames: Y:1.2% UV:0.4% [libx264 @ 0x248eda0] ref P L0: 70.9% 26.5% 1.8% 0.7% 0.0% [libx264 @ 0x248eda0] ref B L0: 99.5% 0.5% [libx264 @ 0x248eda0] kb/s:17664.40 $ x264 --fullhelp | less ... Output bit depth: 8 (configured at compile time) 

Huomaa rivi Incompatible pixel format "yuv420p10le" for codec "libx264", auto-selecting format "yuv420p".

Luultavasti en tarvinnut -profile, ja suuren bittisyvyyden x264: n kanssa se vain toimisi. (ja mahdollisesti valita 444 10-bittistä, jota ffmpeg kutsuu yuva444p10le.) Olen mielestäni suuri bittisyvyys x264 hyväksyä yuv444p14le, mutta tuottaisi silti vain 10-bittistä h.264: ää. Cmdline x264 --fullhelp on melko selkeä lähtöbittisyvyydestä 8-10, ei korkeammasta. On outoa, että

ohitetaan vain äänettömästi 8-bittisellä x264: llä.

Sisäisesti suurelle bittisyvyydelle käännetty x264 käyttää 16 bp: tä minkä tahansa 10-bittisen datan tallentamiseen, joten se todennäköisesti liikkuu haku ja niin edelleen 16-bittisillä arvoilla. Ja DCT saattaa olla korkeampi 16-bittinen kuin 10-bittinen, ellei nopeutta voida saavuttaa jättämällä huomiotta 6-bittinen. Tämä voi tuottaa hieman erilaisia DCT-kertoimia kuin jos pyöristät alas 10 bittiseksi ennen DCT: tä. (Joten saatat saada eri lähdön muuntamalla alaspäin 10 bittiä ennen syöttämistä x264: lle, verrattuna siihen, että annat sille 12, 14 tai 16 bittiä.) Minun pitäisi kuitenkin katsoa koodi tai kokeilla sitä ennen tavaroiden valmistamista. : P

(edit: ffmpeg ei syötä x264-10bit mitään enempää kuin 10 bittiä komponenttia kohden. Se käyttää swscale-toimintoa pienentääkseen itse bittisyvyyttä.)

Mietin kuinka kovaa x264: n ja x265: n korjaaminen olisi käytettävä eri nimiä globaaleille muuttujille ja API-toiminnoille, kun ne on käännetty suurelle bittisyvyydelle. Sitten voit rakentaa molemmat versiot kerralla, ja ffmpeg on linkitetty molempiin. ffmpeg libx264 – ja libx264rgb -kääreet voisivat huolehtia sovelluksen oikean version kutsumisesta tulovirrasta riippuen.(Muussa tapauksessa tarvitset -c:v libx264-deep tai libx264rgb-deep, yhteensä 4 erilaista x264 ”koodekkia” ffmpegissä.)

Kuinka kääntää ffmpeg Windowsille

edit: Windowsissa en usko, että libx264-DLL: lle olisi mitään niin kätevää kuin LD_LIBRARY_PATH , joten paras vaihtoehto on edelleen rakentaa suuren bittisyvyyden omaava staattinen binääri ja toinen normaalikäyttöön. Suuren syvyyden libx264 CAN ”T -ulostulo voi olla normaali syvyys h.264. Ei vain nopeusrangaistus, se vain ei voi.

Helpoin tapa kääntää oma ffmpeg (staattinen binaarinen) Windowsille on https://github.com/rdp/ffmpeg-windows-build-helpers . git kloonaa repo Linux-koneella (tai ehkä toisella järjestelmällä, jossa on toimiva gcc, kuten OS X?), ja suorita sitten

./cross_compile_ffmpeg.sh --high-bitdepth=y --disable-nonfree=n --build-choice=win64

Tämä kesti noin 8 tuntia ensimmäisellä ajona, koska se rakensi mingw-cross-kääntää GCC: n lähteestä kaiken muun kanssa. (gcc oletusarvoisesti rakentaa itsensä useita kertaa käynnistyshihnalle, jos olet alun perin kääntänyt sen väärällä kääntäjällä.)

Voit päivittää koontikomentosarjan git pull -ohjelmalla ja suorittaa sen uudelleen vedä uusimmat gf-päivitykset ffmpeg: lle, x264: lle, x265: lle ja ehkä joillekin muille sen kääntämille projekteille lähteestä. (Useimmille se vain lataa tarballit.)

Linux-työpöydälläni näkyy ikä. wintendo, jota käytän enimmäkseen peleissä. Koska aloin sotkea videokoodauksen kanssa, löydän sen neliytimisen Sandybridin ge melko hyödyllinen myös, esp. x265: lle. Todennäköisesti joillakin x265: n toiminnoilla on vain AVX / SSE4: n asm-versiot, joten se putoaa takaisin C: hen SSSE3 Linux-koneellani (Conroe). Se tai se on huomattavampi nopeudella 1 kuvaa sekunnissa …

Kommentit

  • Ilmoittaako stackexchange ihmisille muokkauksiani? ei ’ t.
  • tämä on paljon yksinkertaisempaa OS X: ssä, jossa käytetään dynaamista linkitystä. Yksinkertaisesti brew reinstall x264 --with-10-bit ja olet valmis, ffmpeg käyttää uutta x264-makua 🙂
  • @SargeBorsch: Tämän vastauksen tarkoituksena oli, että molemmat makut olivat asennettuina samaan aikaan, joten voit verrata 8- ja 10-bittisiä asentamatta kirjasto. OS X: n dynaaminen linkitys toimii melkein samalla tavalla kuin Linux ’ s, jossa voit samalla tavalla korvata libx264 -asennuksesi toisella makulla, jos haluat.
  • @PeterCordes hmm, huono. Olet oikeassa

Vastaa

Latasin ffmpeg-linkin https://sourceforge.net/projects/ffmpeg-hi/?source=typ_redirect

Ja kirjoitti alla olevan komennon luodaksesi 4: 2: 2 1 0-bittinen h.264 -tiedosto:

ffmpeg-hi10-heaac.exe -i "im.mp4" -c:v libx264 -pix_fmt yuv422p10le yuv-high-.ts 

Vastaa

Sähköpostiosoitettasi ei julkaista. Pakolliset kentät on merkitty *