Help with avisynth .mkv plz

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
YoungStreetzD
Joined: Thu Jun 18, 2009 8:51 pm
Org Profile

Help with avisynth .mkv plz

Post by YoungStreetzD » Sun Sep 27, 2009 3:37 pm

Hey, justa complete noob at avisynth, vdubmod etc :?: , just gave this stuff a try yesterday. I have a video which is .mkv, the video codec is x264, the video source is dvd and the audio codec is Nero Digital audio and the video res is 720x480. I used a FFmpegSource (plugin) avisynth script so the video could be imported into virtual dub. It imported nicely into vdubmod but the video looked a bit grainy, interlaced lines, and the aspect ratio was off it looked very squished and there was no audio playing. When i just play this file in vlc player it looks much clearer, correct aspect ratio and no interlace lines, only when it is viewed in vdub it has these problems. Just wondering if you guys which have much more experience and knowledge about this, can help me out on how to get back the sound, get rid of the blurriness and graininess, interlaced lines and get the aspect ratio back to normal. Thanks :o

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Help with avisynth .mkv plz

Post by Scintilla » Sun Sep 27, 2009 4:49 pm

YoungStreetzD wrote:I used a FFmpegSource (plugin) avisynth script so the video could be imported into virtual dub. It imported nicely into vdubmod but the video looked a bit grainy,
Options menu --> Preferences --> Main tab --> set "Output color depth" to "Use output setting".
YoungStreetzD wrote:interlaced lines,
Can't help you there. It sounds as if VLC (or ffdshow, if that's what you're using to decode x264) may be using a deinterlacer for playback.
YoungStreetzD wrote:and the aspect ratio was off it looked very squished
If the video is a 720x480 MP4, then it must have been encoded with a playback aspect ratio flag that makes VLC resize it to the correct AR. AVISynth does not implement such a concept: everything always shows up as square pixels. You generally shouldn't have to worry about this until it's time to encode your video again for distribution; just watch the AR of any still images you add to the video.
YoungStreetzD wrote:and there was no audio playing.
I believe FFMpegSource doesn't load audio by default. There should be an option in the function's parameters to select one of the tracks and have it play; check the documentation for it.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

YoungStreetzD
Joined: Thu Jun 18, 2009 8:51 pm
Org Profile

Re: Help with avisynth .mkv plz

Post by YoungStreetzD » Mon Sep 28, 2009 2:15 pm

o thanks output colour depth worked on the graininess and overall look, but can you clarify how to get the audio back alittle bit more,
I believe FFMpegSource doesn't load audio by default. There should be an option in the function's parameters to select one of the tracks and have it play; check the documentation for it.
didn't really understand this. Also I have alot of plugins but i don't know how to use them in a script is there a guide that explains how to use these plugins in a script? Like what to write etc. THanks

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: Help with avisynth .mkv plz

Post by Qyot27 » Mon Sep 28, 2009 3:59 pm

YoungStreetzD wrote:o thanks output colour depth worked on the graininess and overall look, but can you clarify how to get the audio back alittle bit more,
I believe FFMpegSource doesn't load audio by default. There should be an option in the function's parameters to select one of the tracks and have it play; check the documentation for it.
didn't really understand this. Also I have alot of plugins but i don't know how to use them in a script is there a guide that explains how to use these plugins in a script? Like what to write etc. THanks
FFmpegSource("video.mkv",atrack=-1)

The bolded will enable audio (technically, it'll enable the first audio track it finds; if the file has multiple audio streams, then you would need to use positive 2, 3, 4, etc. if you don't want the first one).

Of course, if you grabbed FFmpegSource2, then just use FFmpegSource2("video.mkv",atrack=-1) - it works the same, even though FFMS2 doesn't cache the audio like 1.21 does - at least, I've not figured out how it would and still work with the script.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

YoungStreetzD
Joined: Thu Jun 18, 2009 8:51 pm
Org Profile

Re: Help with avisynth .mkv plz

Post by YoungStreetzD » Thu Oct 01, 2009 12:50 pm

When i use the FFmpegSource and atrack=-1 or 2, 3 etc it still has no audio to it when it's opened in virtual dub mod. Also the aspect ratio is squished and when i save is as a video I.E lagarith, xvid etc. the aspect ratio is then permanently off even when played on VLC player, sony vegas etc.... any other suggestions on how to fix this? thanks

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Help with avisynth .mkv plz

Post by Scintilla » Thu Oct 01, 2009 5:46 pm

YoungStreetzD wrote:When i use the FFmpegSource and atrack=-1 or 2, 3 etc it still has no audio to it when it's opened in virtual dub mod.
Did you re-open the script after editing it? If a script didn't have audio when you first opened it, simply hitting F5 to save and refresh won't make VirtualDubMod recognize that it now does have audio: you need to reopen it.
YoungStreetzD wrote:Also the aspect ratio is squished and when i save is as a video I.E lagarith, xvid etc. the aspect ratio is then permanently off even when played on VLC player, sony vegas etc.... any other suggestions on how to fix this? thanks
As I said above, it doesn't matter until you're done with your AMV and ready to encode a lossy version to distribute. If you're distributing as an AVI file, then you'll need to resize to the correct resolution for square pixels. If you're distributing as a MPEG-1, -2, or -4 (I'm not sure about Matroska and MKV), then you don't have to resize, but you should be sure to set the proper aspect ratio flag when encoding.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

YoungStreetzD
Joined: Thu Jun 18, 2009 8:51 pm
Org Profile

Re: Help with avisynth .mkv plz

Post by YoungStreetzD » Thu Oct 01, 2009 8:05 pm

Did you re-open the script after editing it? If a script didn't have audio when you first opened it, simply hitting F5 to save and refresh won't make VirtualDubMod recognize that it now does have audio: you need to reopen it.
Ya, I closed vdub and reopened it, but it still had no audio even with the atrak script.

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: Help with avisynth .mkv plz

Post by Qyot27 » Fri Oct 02, 2009 12:09 pm

Scintilla wrote:If you're distributing as a MPEG-1, -2, or -4 (I'm not sure about Matroska and MKV), then you don't have to resize, but you should be sure to set the proper aspect ratio flag when encoding.
Matroska supports aspect flagging, in two different ways - DAR (ratio-based) and desired display resolution (WxH pixel-based).
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

YoungStreetzD
Joined: Thu Jun 18, 2009 8:51 pm
Org Profile

Re: Help with avisynth .mkv plz

Post by YoungStreetzD » Sat Oct 03, 2009 8:04 pm

As I said above, it doesn't matter until you're done with your AMV and ready to encode a lossy version to distribute. If you're distributing as an AVI file, then you'll need to resize to the correct resolution for square pixels. If you're distributing as a MPEG-1, -2, or -4 (I'm not sure about Matroska and MKV), then you don't have to resize, but you should be sure to set the proper aspect ratio flag when encoding.
oh so it will be fine to edit in the inccorect/ slightly squished aspect ratio? When im gonna encode the video how would i set the proper aspect ratio flag? Also if i use avisynth to resize it from 720x480 to 848x480 its an exact match to when its played in VLC its the correct aspect ratio. All my other mkv h.264 never get squished/incorrect aspect ratios its only 1 of them. Also I've tried the atrak= scripts on other h.264 mkvs and vdub is able to find the sound track, the script works perfectly except for...... 1 of mkvs that gives me trouble. any idea why its not working for this individual file?

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: Help with avisynth .mkv plz

Post by Qyot27 » Sat Oct 03, 2009 8:43 pm

YoungStreetzD wrote:oh so it will be fine to edit in the inccorect/ slightly squished aspect ratio?
It only really matters if you're going to use effects, in which case you want to make sure the editor is using the NTSC 0.9 pixel ratio internally, instead of Square Pixels. But resizing the video out to 848x480 means you can use Square Pixels and not worry about the effects looking wrong. It's just a matter of making sure everything matches.
Also if i use avisynth to resize it from 720x480 to 848x480 its an exact match to when its played in VLC its the correct aspect ratio. All my other mkv h.264 never get squished/incorrect aspect ratios its only 1 of them.
The other MKVs weren't anamorphic. It's not a requirement to use that functionality, plus if said other MKVs are 720p HD encodes, there's not much of a point, as the only anamorphic HD resolution I know of is 1440x1080, which is for 1080i/p (and very very few things ever get released at 1080, much less anamorphically). None of the major AviSynth source filters honor aspect ratio flagging, so what you see is how the video itself was actually encoded.
Also I've tried the atrak= scripts on other h.264 mkvs and vdub is able to find the sound track, the script works perfectly except for...... 1 of mkvs that gives me trouble. any idea why its not working for this individual file?
What format is the audio? AC3, AAC, Vorbis, DTS...something else? It's possible (though I don't know under what circumstances) that FFmpegSource simply doesn't support the audio format that was used. To find out, open the MKV in MKVMerge GUI (http://www.bunkus.org/videotools/mkvtoo ... ml#windows). It'll show the tracks and their identifiers, and show what the audio format is.

If you're using the old FFmpegSource 1.21 and not FFmpegSource2, you could try with the newer one, as it uses a newer version of FFmpeg and the support for more formats might be there. Worse comes to worse, you can extract the audio from the MKV with MKVExtract (also part of mkvtoolnix) and then use a different program to decode it, and then add it back into the video later.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

Locked

Return to “AviSynth Help”