Alright, I make documentary(-ish) types of videos that contain text explaining whatever it is I'm trying to explain. (I upload these to YouTube.) I create the un-subbed "raw" video with Videopad and then I create the subtitle file in Aegisub, which generates an .ass file. (Nice file extension, guys...)
Now, I try to retain as much quality as possible (if I see a single compression artifact in any intermediate step, it is unacceptable), and filesize (and therefore, bitrate) is not an issue to me until the final encode which will be uploaded to YouTube.
At any rate, when I save a video in Videopad, I save it in this format:
x264, quantizer = 1
Yes, some may consider it overkill, but the video isn't finished yet. Not only that, but there doesn't seem to be an option to save the video as an uncompressed .avi in Videopad.
The next step is where the trouble comes in. If everything goes as I would want it to, I would simply just open up the video in VirtualDub and then hardcode the text with the TextSub filter with whatever compression settings I choose.
But here's the problem:
In the resultant video, VirtualDub typically (but not always) inserts 0.4 of a second of black frames into the video. However, VirtualDub does not skew the audio or the timing of the subtitles with it. So, both the audio and the subtitles are 0.4 of a second early for the whole video while the video just shows black for the first 0.4 of a second. I know there is an option to skew the audio by a set time, and I know that I could adjust the timing of the subtitles by a set time in Aegisub, but I don't want those 0.4 of a second of black frames at the start of my videos.![]()
I figure that decompressing the video to raw, uncompressed .avi would not produce the same 0.4 seconds of black frames, but it still does the exact same thing.
Now, I know I can get around this by trimming out exactly the 0.4 of a second of black frames in the uncompressed video, save it again as uncompressed, demux the audio from the original video I saved from Videopad, remux it back into the edited uncompressed video and then hardcode the subs with everything finally being correct. Obviously, this is bit of a pain in the neck for something that should be able to be done with one encode.
I've tried decompressing the video and/or hardcoding the text in these programs as well: Avidemux, MediaCoder and SUPER. But nothing both keeps the video and audio/subtitle timings as they should AND gets the formatting of the text right (I'm looking at you, MediaCoder) in one encode. Interestingly, Avidemux and SUPER both still place the 0.4 of a second of black frames (or green frames for Avidemux) in the resulting video.
I would assume that there is some type of problem with a codec or configuration or something if I'm getting similar results across multiple programs. But, I don't know enough about specific codec configurations to begin troubleshooting this problem.
So, is there anybody that can help me solve this problem?
Thank you in advance.![]()
+ Reply to Thread
Results 1 to 6 of 6
-
-
x264's not really a good choice for an intermediate file. But if you have to use it set the GOP size to 1 and the quantizer to 0. The GOP size should get rid of the blank frame problem and the quantizer will give you lossless encoding.
-
Let me guess you're using x264 vfw ? AVI container
Use no b-frames for your intermediate ,or use a different container. This is likely a b-frame issue from using AVI container (another of the many reasons you shouldn't use AVI for h.264)
GOP size of 1 suggested by jagabo will do the same thing (because every frame will be I-frame)
Other options are to use lagarith or huffyuv, or ut video codec (there are all lossless I-frame only formats and should show up as export options in your editor)
(x264 has both lossless intra and inter options, so you could theoretically use b-frames in a lossless mode, but I would stay away from inter, especially if using AVI) -
Thanks for the replies.
Well, I don't have to use x264 for the intermediate video. I was just using it since it seemed like the only way to retain near-lossless quality at the time. And yes, I am (or was) using x264 vfw inside an .avi container. Even before making this thread, I was aware that x264 works better in .mp4 containers. However, in my experience, VirtualDub seems to be the most reliable for hardcoding text, but it will only open .avi files and will only save .avi files. So... I was basically sort of coerced into using .avi.
At any rate, when I go to configure x264 from my editor, this is what I get:
As far as I can tell, there is no option for changing the GOP size.
But that's OK. I downloaded and installed two of the three codecs poisondeathray recommended. The one I did not install is huffyuv because it has not been updated in seven years and because lagarith's description said that it was more efficient than huffyuv in static scenes.
By the way, I am primarily working with video game footage from pretty much all the different eras of video games (including 8-bit and 16-bit consoles [think late `80s, early `90s] where the video footage does not contain much complexity or movement), so I am expecting some frames to be exactly like the next considering the nature of video games and especially considering that I render all my videos at 60fps, except for the "YouTube" versions of my videos, which I cut down to 30fps. (Sorry for the run-on sentence.) I archive my work, so that if I ever want to release higher quality versions of my videos, I will have them, hence why I keep everything at 60fps. In fact, one my last videos contained footage from the Nintendo 64 console, which runs at 30fps, but the video was 60fps. So, every set of frames during the Nintendo 64 footage were duplicates. (I mix in video from more modern video games that run at 60fps, so that's why I render the video at 60fps.)
So... with that being said, that was another reason why I chose lagarith. Continuing with this topic, I am about to try lagarith as I type out this post. From what I gather from reading the description of the settings, these settings should work best for me:
From what I read about null frames, using them would be a perfect application for my type of videos. Let's just hope that VirtualDub will open them. I also have a quad-core processor, so the multithreading option should speed things up. Are these settings the most ideal, given what I am trying to do?
Also, would someone care to explain what the "mode" is? You can select from RGB, RGBA, YUY2 and YV12. I've heard of them before but I don't know exactly what they are (as I've never really had to deal with them) or what the difference is between them. (I'll try RGB for my first test run since it's the default selection.)
And finally one more question. (Sorry...) After I installed the UT video codec, I get EIGHT different options for it when I go to select a codec in my video editor.
Which one should I use?
Thanks again for the help, I really appreciate it. -
Lagarith's Mode should be set to the same colorspace as your source (1). Or if you're filtering in VirtualDub it should be set to RGB because VirtualDub usually converts to RGB when filtering. You are correct about the other settings.
Regarding the x264vfw settings: that simplified UI doesn't directly support all the available x264 settings. You can enter them manually in the "extra command line" box. All I frames would be "--keyint 1". It looks like you can't set the CRF/CQP value to 0 (lossless). Maybe adding it manually will override the slider: "--crf 0" or "--qp 0"
(1) Analog (TV) video isn't transmitted as RGB but as YUV. When captured is is usually YUV with 4:2:0 chroma subsampling (YV12) or 4:2:2 chroma subsampling (YUY2 or similar). Many programs can't deal natively with YV12 or YUY2 video so they convert to RGB. More info on colorspaces: http://fourcc.org/ -
I tried Lagarith with the above settings used and it works great in both VirtualDub and Aegisub. Actually, it works better in Aegisub since I can jump directly to the frame that I want to go to instead of having to work my way to it from a point before it. (I'm sure this is because there were B-frames in my previous intermediate videos.)
As far as the colorspace of my source goes, my capture device uses x264 hardware encoding, so I'm not sure if it converts to RGB while it captures or if it just keeps it YUV. Either way, I haven't had a problem with anything up until hardcoding the text in VirtualDub, so I'll save my edited videos with Lagarith in RGB just for that. Thank you for the link to the website that explains the colorspaces in detail. I've skimmed through some of the pages, but I haven't had the time to read everything in detail yet.
I figured that the "extra command line" box in the x264vfw settings would let one do a lot more with the codec if they knew what they were doing. I have no experience and no education in any type of coding or programming though. (That's why I don't even attempt to use Avisynth. When I read a script for it that somebody posted, I can follow some of it, but I don't know what the specific words, parenthesis, commas, apostrophes and all of that mean.) Thank you for posting the command lines though. But it looks like Lagarith might be the best thing for me to use, especially if it's uncertain if I can even change the quantizer to 0.
Thank you again for the help, jagabo and poisondeathray. I really appreciate it.
Similar Threads
-
horizontal lines in x264 encoded dvd using MeGUI
By codemaster in forum DVD RippingReplies: 5Last Post: 9th Dec 2010, 06:48 -
Artifacts/noise around text in Xvid encoding, and not with x264?
By nyriador in forum DVD RippingReplies: 4Last Post: 21st Jun 2010, 11:58 -
How to open a x264 encoded mp4 in VirtualDubMod?
By Sedoc94 in forum Newbie / General discussionsReplies: 27Last Post: 1st Jun 2010, 17:36 -
Alternate method for importing x264 cli encoded videos for.. [RESOLVED]
By vhelp in forum Video ConversionReplies: 7Last Post: 23rd Dec 2008, 20:30 -
x264 encoded mkv/mp4 transcode to xvid encoded avi
By graysky in forum Video ConversionReplies: 4Last Post: 9th Aug 2008, 18:55