Hello from Germany!
I hope you can help me. I use since today the program MeGUI (version 2896) in order to convert my raw videos with x264 codec into MP4 files. First I export the videos with Magix Video Deluxe im AVI format with help of Lagarith plugin. Settings has been set to the color mode YV12 as the original content also use the same color range. Then I open the AVI with MeGUI and create an AVS file with Tools > AVS Script Creator. The source video is Full HD content (1080p). All settings has been set to default or beeing disabled. My AVI-Script looks as following:
For the x264 Codec I use following settings:Code:AVISource("F:\Downloads\Videotests\Wasserfarben.avi", audio=true).AssumeFPS(50,1) #deinterlace #crop #resize #denoise
The output file format is MP4. After encoding I noted that the colors of the finished video looks different to my source material, especially in green and blue areas. I have attached two pictures to show what I mean.Code:--crf 21.5 --keyint 30 --min-keyint 16 --bframes 2
I have already tried all sorts of options, but I have not come to the desired result. I also found this: https://forum.doom9.org/showthread.php?t=156161
but it seems that the command "-- fullrange" is no longer supported by the latest version (x264.exe: unknown option -- fullrange) . I even can't start converting the video with this command.
It does not matter which video player is used for the output. The result is the same with both MPH-HC (Media Player Classic) and VLC player, and also Magix Video Deluxe shows these differences after opening the file. Anyone else had this strange problem? What else can I do to get exactly the same colors as in my source videos?
+ Reply to Thread
Results 1 to 29 of 29
-
-
Test add a script:
ConvertToYV12(matrix="pc.709") or
ConvertToYV12(matrix="pc.601")
And.. add ' --fullrange on' to your x264 settings.責任者-MDX -
-
-
-
add colormatrix after the source filter
it would look like
AVISource(..."PATH/lagarith file.avi")
Colormatrix(...)
post your full script -
That may mean megui doesn't include the ColorMatrix() filter. You can convert to RGB then back to YV12 to get the same transform, but with less accuracy.
ColorMatrix(mode="rec.601->rec.709") is equivalent to ConvertToRGB(matrix="rec601") followed by ConvertToYV12(matrix="rec709").
ColorMatrix(mode="rec.709->rec.601") is equivalent to ConvertToRGB(matrix="rec709") followed by ConvertToYV12(matrix="rec601"). -
@jagabo You're right, I skipped reading that part .. 'Settings has been set to the color mode YV12' .. sorry
@PARALAX .. surely ColorMatrix will help.責任者-MDX -
MeGUI should come with ColorMatrix but you'll probably have to load it yourself.
AVISource("F:\Downloads\Videotests\Wasserfarben.av i", audio=true).AssumeFPS(50,1)
LoadPlugin("C:\Program Files\MeGUI\tools\avisynth_plugin\ColorMatrix.dll" ) # or wherever it is
ColorMatrix(mode="rec.601->rec.709")Last edited by hello_hello; 30th Apr 2019 at 13:54.
-
Thank you so much, guys! Now it works and the result really looks as expected. Finally, the hours-long unsuccessful Google search and endless experimenting has come to an end.
I have a few more questions that only concern the optimization of time:
1.) Using the following commands in my script works:
ConvertToRGB(matrix="rec601")
ConvertToYV12(matrix="rec709")
but if I try to replace it with "ColorMatrix(mode="rec.601->rec.709")" instead, I get following error message, see my attachment.
I've already learned about MeGUI and the color matrix plugin and came across the information that this filter should already be included in MeGUI. In fact, this file is in my version under "tools/avisynth_plugin/ColorMatrix.dll". How do I integrate them so that I can use this command in the future?
2.) Is it somehow possible the to save the ColorMatrix or further commands in MeGUI without having to change the script again each time? So far, I go to convert my videos as follows: Tools > AVS Script Creator, Open AVI File via Video Input, choose AVISource, Close Video preview and change the script content manually (e.g. audio=true, adding the RGB and YV12 commands etc.). However, it would be a great time saver for me if all these things were already done automatically or at least the script commands that I need each time are already included. How can I do that?
3.) Is it possible to create tasks, jobs or scripts for several videos with the same commands without doing the above mentioned steps every time again?
4.) Is there any way to speed up the color conversion? When converting a video with a length of 1:40 and 60 fps my Intel i7 PC (3.4 Ghz) requires 5:20 Min with the commands ConvertToRGB and ConvertToYV12. Without these commands, it is only 3:35 min.Last edited by PARALAX; 30th Apr 2019 at 09:44.
-
Thanks! This also works after correcting a small clerical error "(" instead of "I".
With the ColorMatrix-Plugin I could decrease the computing time during the conversion to 4:10 Min. with the same video.
Nevertheless, the steps that are necessary for it are quite time consuming since I have to do it for every conversion over and over again. That's why I hope that my other questions can still be answered. -
"No function named ColorMatrix" means the dll has not been loaded. hello_hello told you how to load the filter to make it available in post #11.
In megui's tools folder there is a folder called AVS. Inside that is a folder called plugins. Maybe if you put the dll in there it will autoload. -
-
The problem in the first place - is when you export lagarith from your editor, which is probably working in RGB, it's probably doing the conversion RGB=>YV12 with incorrectly with Rec601 (wrong colors for HD)
Instead, if you use magicyuv, you can specify it to use Rec709 for the correct conversion in the first place. Then you don't have to do the other steps or conversions that slow you down, and cause additional quality loss. It's also much faster for encoding and decoding, but at the expense of lower compression (larger filesizes and HDD space required for the intermediates)
In the magicyuv settings you would use mode (conversion) YUV 4:2:0 , and YUV colormatrix Rec709
You can batch encode with avisynth scripts, but you would need 1 script per video . There are batch avs scripters, but another option is to avoid avisynth or megui all together, and use ffmpeg to batch encode all your AVI's at once directly. That would be faster because it muxes, encodes audio, video together, and avoids the avisynth overhead
Or if you still want to use megui, it will still be faster with magicyuv - because you avoid the colormatrix or converttoXX slowdown steps
hello_hello will correct me on this, but I think megui has a 1 click where it can batch process a folder . (But it will still be slower than batch encoding with ffmpeg, because megui encodes audio, video separately, then muxes separately) -
Thanks for this helpful tips!
Is it possible to use Magicyuv as VFW-Plugin for video editing software as well? Lagarith for example has been installed by K-Lite Codecpack, so I could use it directly when exporting my video with "Magix Video Deluxe" as AVI-File. I would also need this to export the video in lossless format and with the correct colors to avoid doing this later by the ColorMatrix-Filter. But I can only use it, if it's guaranteed that I still can open the exported AVI with MeGUI which I need to encode with x264. -
-
Maybe it would help if you could explain why you need this Magix Video Deluxe to begin with. Is it only to create the AVI from your 'source' MP4? Can't you use the MP4 directly in MeGUI? Or if you're performing some filtering in Magix Video Deluxe, can't it be done in AviSynth and MeGUI?
I expect any MagicYUV AVI will be opened in MeGUI as easily as a Lagarith AVI. -
Whoops.
Can you specify rec.709 when exporting from Magix Video Deluxe? It sounds like Magix Video Deluxe is converting the YV12 source to RGB for processing, correctly using rec.709, but when you export it's converted back to YV12 using rec.601. If the video stays YV12 all the way, or it's converted to RGB and back using the same formula (rec.601 or rec.709) the colors shouldn't change. It's only when converting to and from RGB that the colorimetry will change.
What are your source files? SD is usually rec.601 and HD is usually rec.709, although it's possible for HD to be rec.601. I'd be looking for the cause if possible.
If you're not using MeGUI to apply any cropping or resizing etc, it might be easier to create scripts with AviSynthesizer. When it's installed, you can create/edit script templates. They're just text files with an avst extension. AviSynthesizer runs via the Explorer right click SendTo menu. You right click on a file, choose AviSynthesizer, it opens a window containing the list of templates, you choose one, and AviSynthesizer creates the script. I assume your template would need to look like this for the original Avisnthesizer.
#ASYNTHER AVISource
[AVISource("%f", audio=true)]
LoadPlugin("C:\Program Files\MeGUI\tools\avisynth_plugin\ColorMatrix.dll" )
ColorMatrix(mode="rec.601->rec.709")
And like this for the mod version.
#ASYNTHER AVISource
[AVISource("___FILE___", audio=true)]
LoadPlugin("C:\Program Files\MeGUI\tools\avisynth_plugin\ColorMatrix.dll" )
ColorMatrix(mode="rec.601->rec.709")
AviSynthesizer
MeGUI's OneClick encoder supports batch encoding. Just open a folder after you've configured it to your liking. It can use scripts as input files. I don't use OneClick myself, but if you're keen to use AviSource, you'll probably have to move it to the top of the list in the OneClick profile configuration.
And... you can also create script templates.Last edited by hello_hello; 30th Apr 2019 at 14:58.
-
I need it to cut and rework my source videos, even because I need to add some subtitles and watermarking for YouTube. For Blu-Ray Authoring I only use cuts in most cases (and that's the other problem I have currently, see here: https://forum.videohelp.com/threads/393028-Converting-a-Lagarith-AVI-to-Blu-Ray-%2850i...MeGUI-and-x264)
Maybe you can also help me out with it because all my tests failed yet. The YV12 color problem should be solved since I have the choice between reworking later or doing it with MagicYUV (which isn't free by the way but that's okay if it's working for me).
The Blu-Ray problem, and especially the conversion of 50P or 60P videos into usable 50i material (which is recognized by MPC-HC as 25i material) is the most difficult hurdle I have yet to overcome. But I need it to burn my videos in 1080i50 on Blu-Rays.
No, I can't change any color settings in this program but obviously I don't have to do it because all videos which I did export with Magix Video Deluxe directly did have the correct colors, no matter if I use the basic MP4 export, "Main Concept" or Blu-Ray MPEG. However, the image quality is not as good as with the x264 codec, especially for fast movements or scenes like sky shots, but I only have a VFW plug-in with far fewer options in the program. That's why I export with Lagarith and do the rest with MeGUI instead. Obviously only the Lagarith plugin is to blame but it's free and the only tool for exporting lossless material, which I knew so far.
What are your source files? SD is usually rec.601 and HD is usually rec.709, although it's possible for HD to be rec.601. I'd be looking for the cause if possible.
Incidentally, I have just after some tests found out that when exporting to xVid AVI's exactly the same color problem occurs like with Lagarith. So there seems to be other plugins that are struggling with that.Last edited by PARALAX; 30th Apr 2019 at 15:18.
-
The free 1.2 rev2 beta will work fine
https://www.videohelp.com/download/MagicYUV_v1.2_win-rev2.exe
You don't need the "pro" version (which has other features like higher bit depths that you aren't using)
It's a known issue - when you send RGB to lagarith, and you use it in YV12 mode, it will do the RGB=>YV12 conversion with Rec601 (wrong colors for HD)
Alternatively, you can export lagarith (or anything) in RGB mode, then use avisynth to convert to YV12 with 709
The Blu-Ray problem, and especially the conversion of 50P or 60P videos into usable 50i material (which is recognized by MPC-HC as 25i material) is the most difficult hurdle I have yet to overcome. But I need it to burn my videos in 1080i50 on Blu-Rays. -
I'm not sure I completely understand your process, and I've never created a Bluray compliant disc because there's MKVs, but some thoughts.....
50p can be converted to 50i by simply removing half the fields in Avisynth.
Code:SeparateFields() SelectEvery(4,0,3) Weave()
I'd probably resize the video to 720p and keep it 50fps in preference to making it interlaced, as 720/60p and 720/50p are Bluray complaint.
Avisynth can convert 60p to 50p, or 60p to 50i.
To convert 60p to 50i, the simplest way is to remove/blend frames for 50p and then remove half the fields for 50i.
Code:ConvertFPS(50,1) SeparateFields() SelectEvery(4,0,3) Weave()
Code:FrameRateConverter(50,1) SeparateFields() SelectEvery(4,0,3) Weave()
Code:A = AVISource("F:\Downloads\Videotests\60fps.avi) B = AVISource("F:\Downloads\Videotests\50fps.avi) A = A.FrameRateConverter(50,1)\ .SeparateFields()\ .SelectEvery(4,0,3)\ .Weave() B = B\ .SeparateFields()\ .SelectEvery(4,0,3)\ .Weave() A.Trim(4362, 5861) ++ B
You can tell MeGUI to instruct x264 to write a raw h264 stream rather than MKV or MP4 and any muxing/Bluray authoring program should be able to open it, or if you use the OneClick encoder, M2TS is an option.Last edited by hello_hello; 30th Apr 2019 at 16:30.
-
-
Yes, I heard of this and I really would like to give it a try. Unfortunately, my only authoring program "Corel VideoStudio" (even an older X4 version), which I get along with can not handle it. Not even 720p50 or 1080p25 formats are accepted, without being re-encoded in 1080i50 format, the only I can use. And I can not cope with other chapter tools like the "Chapter Creator" from MeGUI. In addition, it is much more cumbersome to set certain chapters if you do not have a video preview.
For this reason, I'm searching for a meaningful, understandable and not too HDD space overloaded alternative that can do it all - both video preview, as well as the addition of chapters, menus with pictures and music, the support of 720p and 1080p content and the export in ISO format which I can burn with "IMGBurn" on BD-R. If you have a good tip for me I would be very grateful to you. For such a software, I would also always willing to pay money if it is well spent and you are not constantly annoyed by advertising, adware or crashes. The software should then still be Windows 7 compatible.Last edited by PARALAX; 30th Apr 2019 at 22:06.
-
MeGUI's chapter creator has gone through a few changes lately. It now works much the same way as ChapterGen. It's had a preview for as long as I can remember. I don't use it much but I assume you have to create an Avisynth script to open the video and use that as the source for the preview.
BD Rebuilder is a popular freeware program but I've barely used it myself as I hate menus and chapters, and I've never burned a Bluray complaint video disc, so I can't offer any other advice there. I can't remember if BD Rebuilder has been mentioned yet, so sorry if I'm repeating something, and I don't know if it can be used to create menus etc from scratch. -
You do not need chapters, just split long, long videos into clips and give them appropriate names so it it is lined up alphabetically. 2018-12-04 01 Road to Tumbaktu start, 2018-12-04 02 Road to Tumbaktu River, etc. Everyone including you would find whatever content in a instance. This way you don't even need menus because in all UI's it is going to be lined up correctly. Then you can use mp3tag to insert pictures into videos or create jpg's that have the same names as clips. Also it is ready to be put on any platform you can think of later on.
-
I convinced myself that it makes no sense to create elaborately designed Blu-Rays with menus, see here: https://forum.videohelp.com/threads/393028-Converting-a-Lagarith-AVI-to-Blu-Ray-%2850i...e2#post2550124
MP3Tag has been with me for several years and has always been a great help in sorting and standardizing MP3s. But that you can also save images and other MP3-specific information within MP4 or video files, is completely new to me. Are there no compatibility problems with various players or media devices? For MP3s, it is still understandable but video files such as MP4's, which were created with x264, but are actually not intended.
Similar Threads
-
MeGUI stopped encoding audio at 89%
By pooksahib in forum Video ConversionReplies: 5Last Post: 18th Oct 2018, 20:37 -
MeGui crashes before encoding video
By yukukuhi in forum Video ConversionReplies: 3Last Post: 3rd Jul 2016, 12:25 -
Encoding Video8 with Megui and QTGMC
By ackboo in forum Newbie / General discussionsReplies: 27Last Post: 3rd May 2015, 16:05 -
Encoding Multiple VOBs with MeGUI
By Abbotta4 in forum Newbie / General discussionsReplies: 4Last Post: 21st Jul 2014, 10:33 -
MeGui: Trim video after encoding
By medwatt in forum Newbie / General discussionsReplies: 3Last Post: 11th May 2014, 20:34