magicyuv encoding/screen capture in cinGG
Hello! I tried magicyuv encoding in CinGG, it works with attached option file, and can be viewed in mplayer (compiled with latest ffmpeg git) after I modified .mplayer/codecs.conf cat magicyuv.qt mov magicyuv pix_fmt=yuv444p threads=2 (for some reason first pixel format in encoder's options in CinGG list still not what i tried to set as pix_fmt, so just for being extra safe I set it manually) add this into mplayer's codecs.conf: videocodec ffmagicyuv info "FFmpeg Magicyuv" status working fourcc M8Y4 ;format 0x3459384D driver ffmpeg dll "magicyuv" out YV12,422P,444P,422P10,444P10 After this, mplayer plays this file (24Mb/s for just 1440x900x24bpp_30 fps!) mplayer /dev/shm/magicyuv.ff -vo x11 MPlayer SVN-r38152-5.5.0 (C) 2000-2019 MPlayer Team 224 audio & 466 video codecs Playing /dev/shm/magicyuv.ff. libavformat version 58.33.100 (internal) libavformat file format detected. [mov,mp4,m4a,3gp,3g2,mj2 @ 0x575f59e0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol [lavf] stream 0: video (magicyuv), -vid 0 [lavf] stream 1: audio (pcm_s16le), -aid 0, -alang rus VIDEO: [M8Y4] 1440x900 24bpp 30.000 fps 197394.6 kbps (24096.0 kbyte/s) ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family libavcodec version 58.59.102 (internal) Selected video codec: [ffmagicyuv] vfm: ffmpeg (FFmpeg Magicyuv) ========================================================================== Clip info: major_brand: qt minor_version: 512 compatible_brands: qt encoder: Lavf58.29.100 Load subtitles in /dev/shm/ ========================================================================== Forced audio codec: mad Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000) Selected audio codec: [pcm] afm: pcm (Uncompressed PCM) ========================================================================== AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Movie-Aspect is undefined - no prescaling applied. [swscaler @ 0x57889140]bicubic scaler, from yuv444p to bgra using MMXEXT VO: [x11] 1440x900 => 1440x900 BGRA [VD_FFMPEG] DRI failure. Movie-Aspect is undefined - no prescaling applied. VO: [x11] 1440x900 => 1440x900 BGRA A: 0.2 V: 0.0 A-V: 0.171 ct: 0.000 0/ 0 ??% ??% ??,?% 1 0 [VD_FFMPEG] DRI failure. A: 30.0 V: 30.0 A-V: 0.027 ct: 0.110 0/ 0 3% 70% 2.2% 15 0 I also tried dvcpro100 encoding, but it probably requires interlaced project (and patches, of course).... Just in case you want to play with them, also attached (from ffmpeg mail list see http://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/249795.html )
Always interesting are your tests; thank you. I've seen that Magicyuv is not open source, but it's free for 8 bits.
From wikipedia I found the codecs Lagarith and Turing, do you know them? Lagarith (lossless) seems to be the highest quality but also very slow in single threads: https://lags.leetcode.net/codec.html Turing (lossy) is the analogue of h265 but, it seems, much more efficient: http://turingcodec.org/
В сообщении от Sunday 20 October 2019 10:39:06 Andrea paz написал(а):
Always interesting are your tests; thank you. I've seen that Magicyuv is not open source, but it's free for 8 bits.
support for decoding and encoding was added into ffmpeg (open-source implementation) in 2016 and 2018: search https://git.ffmpeg.org/gitweb/ffmpeg.git for magicyuv: 2018-06-05 Paul B Mahol avcodec/magicyuvenc: mark as not more experimental 2017-10-28 Paul B Mahol avcodec: add MagicYUV encoder 2016-05-31 Paul B Mahol avocdec: add MagicYUV decoder from https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/magicyuvenc.c AVCodec ff_magicyuv_encoder = { .name = "magicyuv", .long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MAGICYUV, .priv_data_size = sizeof(MagicYUVContext), .priv_class = &magicyuv_class, .init = magy_encode_init, .close = magy_encode_close, .encode2 = magy_encode_frame, .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, so yeah, 8bit encode, yet most screens still 8 bit per component (in framebuffer) :} Decoder support 10 bit, but I have no such examples, and mplayer a bit picky about what I put in codecs.conf
From wikipedia I found the codecs Lagarith and Turing, do you know them? Lagarith (lossless) seems to be the highest quality but also very slow in single threads: https://lags.leetcode.net/codec.html
yeah, I think my friend tried it, very slow it was ....
Turing (lossy) is the analogue of h265 but, it seems, much more efficient: http://turingcodec.org/
From this page I see it just another HEVC/h265 encoder, analogue of x265? never tried it .... "The Turing codec is an H.265/HEVC software video encoder and decoder for efficient video compression" If they have ffmpeg patch you can try it :}
"The Turing codec is an H.265/HEVC software video encoder and decoder for efficient video compression" If they have ffmpeg patch you can try it :}
No, ffmpeg does not support Turing. So should one create a patch to include it? It's beyond my capabilities. Lagarith is included in ffmpeg instead. Just create the .opts file to have it in CinGG?
В сообщении от Sunday 20 October 2019 12:57:00 Andrea paz написал(а):
"The Turing codec is an H.265/HEVC software video encoder and decoder for efficient video compression" If they have ffmpeg patch you can try it :}
No, ffmpeg does not support Turing. So should one create a patch to include it? It's beyond my capabilities.
They had patch, but against ffmpeg from 2016! http://turingcodec.org/index.php/documentation/ ====== Integration with FFmpeg Warning: the following instructions are for Linux only. Prerequisites: You need to rebuild the code to install the Turing codec’s libraries on the FFmpeg source directories. To do this, type the following: cmake -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" .. make install Get the required ffmpeg dependencies at https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#GettheDependencies. Build: Create the directory where the FFmpeg sources will be downloaded. mkdir ~/ffmpeg_sources Follow the instructions in https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#ffmpeg but: Instead of using wget and tar, clone ffmpeg from this branch https://github.com/kupix/FFmpeg-1/tree/libturing. Add --enable-libturing and remove --enable-xxx for libraries you don’t have (e.g. libx264). Test: To test the encoder, type the following: ffmpeg -i in.mp4 -c:v libturing -turing-params speed=fast out.mp4 ====== https://github.com/kupix/FFmpeg-1/commits/libturing last two commits
Lagarith is included in ffmpeg instead. Just create the .opts file to have it in CinGG?
Not sure if there is encoder or decoder only? Looking .... probably decoder only .... I can see https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/lagarith.c but no lagarithenc or anything like this ... Also git search shows a lot of work since 2011, but no 'encoder' word
Lagarith is included in ffmpeg instead. Just create the .opts file to have it in CinGG?
Not sure if there is encoder or decoder only? Looking .... probably decoder only ....
$ ffmpeg -codecs Legend codecs: D..... = Decoding supported .E.... = Encoding supported ..V... = Video codec ..A... = Audio codec ..S... = Subtitle codec ...I.. = Intra frame-only codec ....L. = Lossy compression .....S = Lossless compression ... D.VI.S lagarith Lagarith lossless ... (Not line for turing) ... Yes, you are right. Lagarith is only decoder (Decoding.VideoIntraframe.Lossless). Very slow + only decoder = Not interesting :-)
CinGG can already open and edit files that are in Lagarith (as well as in Huffyuv). I have in the past, captured with VirtualDub (under Windows) video sequences that I had encoded in Lagarith (YUY2 or YV12). Then edited in CinGG and, finally, returned to Windows (rendered in raw_yuyv422.qt) to be de-interlaced with the QTGMC script through Avisynth (under Windows). Unfortunately under Linux, I know nothing as powerful as QTGMC (in placebo mode) to de-interlace without artifacts resulting from old SD sequences. All this to say that CinGG already allows Lagarith 720x480 422 8bits YUV interlaced sequences to be used very efficiently in editing. Pierre On 19-10-20 07 h 17, Andrea paz wrote:
Lagarith is included in ffmpeg instead. Just create the .opts file to have it in CinGG?
Not sure if there is encoder or decoder only? Looking .... probably decoder only ....
$ ffmpeg -codecs
Legend codecs: D..... = Decoding supported .E.... = Encoding supported ..V... = Video codec ..A... = Audio codec ..S... = Subtitle codec ...I.. = Intra frame-only codec ....L. = Lossy compression .....S = Lossless compression
... D.VI.S lagarith Lagarith lossless ... (Not line for turing) ...
Yes, you are right. Lagarith is only decoder (Decoding.VideoIntraframe.Lossless). Very slow + only decoder = Not interesting :-)
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Pierre autourduglobe