FAQ contenus de différents types
| Main Page | General Info | Loading clips | Loading Scripts | Common Error Messages | Processing Different Content | Dealing with YV12 | Processing with Virtualdub Plugins |
La vidéo et l'audio de mon encodage final sont désynchronisés, que dois-je faire?
En supposant que vous avez traité votre vidéo et/ou audio avec AviSynth, il y a plusieurs raisons possibles pour expliquer que votre encodage final est désynchronisé. Les plus courantes sont les suivantes:
1) Votre source est déja désynchronisée (ceci avant traitement par AviSynth ou avant encodage). C'est très difficile à corriger, mais ce n'est pas l'objet de cette FAQ.
2) L'audio a un délai constant, et vous avez oublié de rajouter le délai (doit dans AviSynth si vous avez importé l'audio avec AviSynth soit dans un encodeur si vous avez importé l'audio directement dans votre encodeur). Par exemple, le flux audio démultiplexé d'une VOB a souvent un délai. Quand vous démultiplexez ce flux audio avec DGIndex, le délai (en fait comment le délai doit être corrigé) est écrit dans le nom du flux audio démultiplexé. Vous pouvez utiliser DelayAudio pour ajouter ce délai dans AviSynth.
vid = MPEG2Source("D:\film.d2v") aud = NicAC3Source("D:\film T01 2_0ch 448Kbps DELAY -218ms.ac3") AudioDub(vid, aud) DelayAudio(-0.218)
3) L'audio a un délai variable (avec un délai nul au début et un délai maximum à la fin). Ceci peut être causé par le fait que vous chargez dans AviSynth un clip qui a une fréquence variable. A peu près tout sauf les vidéo contenues dans un fichier AVI ou MPEG-2/VOB peut avoir une fréquence variable. Si vous utilisez DirectShowSource pour charger votre clip, vous pouvez utiliser
# un fichier mkv est utilisé ici comme exemple: DirectShowSource("D:\film.mkv", fps=xxx, convertfps=true) # fps = fréquence moyenne
Ce qui se passe est que des trames sont ajoutées ou supprimées pour assurer la synchronisation, le convertissant ainsi en une vidéo à fréquence fixe.
Si vous n'utilisez pas DirectShowSource ou que vous ne souhaitez pas ajouter ou supprimer des trames, vous devez d'abord créer un fichier de timecodes et l'utiliser ensuite dans votre encodage final. Jetez un coup d'oeil à cet article pour plus d'informations à ce sujet.
How do I recognize progressive, interlaced, telecined, hybrid and blended content?
It is important to know your content if you want to process it. The most important ones are: progressive, interlaced, telecined, hybrid and blended content, and they should be processed differently.
- Progressive and interlaced content:
Most filters assume that your content is progressive (which means that every frame is taken at a different time-instant), unless the filter has an option interlaced=true/false. When the option is present you can use interlaced=true for interlaced content. For interlaced content, every field (a frame consists of two fields) is taken at a different time-instant. This is explained in the Analog Capture Guide and the Force Film, IVTC, and Deinterlacing tutorial.
- Telecined content:
Usually movies are shot at 24 fps (frames per second). When putting this on a dvd, fields are added to match the NTSC frame rate, which is closer to 30 fps. When doing this, the content is called "telecined content" (this holds for the conversions 25 fps -> 30 fps and 24 fps -> 25 fps as well, provided fields are added). More about this can be found in the Force Film, IVTC, and Deinterlacing tutorial.
- Hybrid content:
Hybrid content is content with different base frame rates (for example 8, 12, and 16 fps at which anime is often drawn). Start Trek is a different example consisting of telecined (at 30 fps) and interlaced content (at 30 fps). Have a look at this article for more information on this subject.
- Blended content:
Blended content is content which consists of blended fields (in some fields there is content from different time-instants visible). It's usually the result of bad NTSC to PAL conversions (and vice-versa), or messed-up deinterlacing. Some examples can be found here or here.
How do I process interlaced content?
There are two ways to process your interlaced content (assuming that you use a filter which has no interlaced=true option). The first one is the most accurate, but also the slowest: bobbing, processing and reinterlacing. The second one is the fastest, but also less accurate one: processing the fields separately.
1) bobbing:
AssumeTFF() # or AssumeBFF (set the video's field order correctly) TDeint(mode=1, type=3) # or any other smart Bob Filter(...) AssumeTFF() # or AssumeBFF (set the video's field order correctly) Separatefields() Selectevery(4,0,3) Weave()
2) processing the fields separately:
SeparateFields() even = SelectEven(last).Filter(...) odd = SelectOdd(last).Filter(...) Interleave(even, odd) Weave()
How do I process telecined content?
You need to inverse telecine (IVTC) before you do any processing. You can use the plugin Decomb for example, which can be downloaded here. See the tutorials "Force Film, IVTC, and Deinterlacing" or "Analog Capture Guide" which explain how to do this.
How do I process hybrid content?
You only run into troubles when your clip as openend in AviSynth shows combing (being partly interlaced, telecined, etc ...). I'm not sure yet what to do in that case.
What is variable framerate video?
There are two kinds of video when considering framerate, constant framerate (cfr) video and variable framerate (vfr) video. For cfr video the frames have a constant duration, and for vfr video the frames have a non-constant duration. Many editing programs (including VirtualDub and AviSynth) assume that the video is cfr, partly because avi doesn't support vfr. Although the avi container doesn't support vfr, there are several containers (mkv, mp4 and wmv/asf for example) which do support vfr. More information can be found here.
How do I import variable framerate video into AviSynth and how do I process it?
There are two ways to import variable framerate video into AviSynth:
1. Open the video in AviSynth using for example DirectShowSource(..., convertfps=false) or FFmpegSource. The problem is that in those cases no frames are added or removed to convert it to constant framerate video to ensure sync. Generate a timecode file using some external program or using the AviSynth plugin you use for importing the video into AviSynth (if possible). Many non-AVI files contain video with a variable framerate, and in that case you need to make sure of the following two things:
- Don't change the framerate and the number of frames in AviSynth. If you don't this (and you don't change the timecodes file manually) your video and audio in your final encoding will be out of sync.
- Use the timecodes file again when muxing your encoded video and audio. If you don't do this your video and audio in your final encoding will be out of sync.
2. Open the video in AviSynth using for example DirectShowSource(..., convertfps=true). In this case frames are added or removed to convert it to constant framerate video to ensure sync. You can process the video the way you want. You can even create a new timecodes file and create a new variable framerate video using it. More information can be found here.
Regarding the first way. If you did change the framerate or the number of frames, you can use DeDup to recreate a new timecode file:
dedup_dedup(threshold=0.1, maxcopies=10, maxdrops=4, log="01.log", timesin="original.tmc", times="final.tmc")
The parameter "timesin" specifies the timecode file of the original video on which the output file will be based on (rather than just using the input stream's framerate). I never used it, so I'm not sure how good this is. Look here for a discussion.
| Main Page | General Info | Loading clips | Loading Scripts | Common Error Messages | Processing Different Content | Dealing with YV12 | Processing with Virtualdub Plugins |