Changes

PAL Speedup

5,022 bytes added, 6 November
/* Discussion of reversing PAL speedup */
The following lines were added (+) and removed (-):
PAL Speedup is a nasty side effect from the process of making film into home video for European audiences.  It results in distorted video.  It is a widespread problem that is not sufficiently addressed in the Internet video community.  In a nutshell, PAL Speedup is when a movie file plays slightly too fast, so it is shorter than it is supposed to be, and all the actor voices are slightly higher pitch than they should be.  To some, it is not noticeable, while to others it is maddening.  It is such a slight difference that it is right on the edge of human perception.  Yet, if you notice it, then you don't like it.PAL Speedup is a nasty side effect from the process of converting film into home video for European audiences.  It results in distorted video.  It is a widespread problem that is not sufficiently addressed in the Internet video community.  In a nutshell, PAL Speedup is when a movie file plays slightly too fast, so it is shorter than it is supposed to be, and all the actor voices are slightly higher pitch than they should be.  To some, it is not noticeable, while to others it is maddening.  It is such a slight difference that it is right on the edge of human perception.  Yet, if you notice it, then you don't like it.Exception: If a video is from original European production, such as a television program produced in the UK and is already PAL, the frame rate will be 25 fps source to 25 fps digital.  In this event a digital video file of 25fps will not have any speedup, since the source was already 25 fps.  When checking a video frame rate know that the mere fact it is 25 fps does not necessarily mean that it will be higher pitch and shorter duration.  To verify PAL Speedup, you must know what the correct playtime is and compare that to the playtime of the file.  Such exception cases represent the small minority of PAL video files you will encounter, most suffer from PAL speedup.  == Discussion of reversing PAL speedup =='''I. You can use command line parameters to force a workable video player to compensate for PAL speedup, thus restoring the proper audio pitch and playtime duration.'''VLC Player aka [[VideoLAN Player]] will easily accomplish this and has been able to for many versions to present.Example: vlc -f videofilename.avi --no-audio-time-stretch --rate=0.96 --no-embedded-video --no-sub-autodetect-file vlc://quit If you install zenity on your linux system you can use the following shell script called [altplayer] which will give you a dialog and allow you to choose NTSC or PAL when launching VLC to play a video.See Also: [[Compensate for PAL Speedup in Digital Video]].VLC can be made to correct for the speed and audio pitch problems introduced by crappy PAL video in multiple ways besides using command line parameters.{{:VideoLAN_Player_Compensate_for_PAL_Speedup}}Question:  Can a flag be set in the video file such as a tag in an mkv file to instruct a video player that it shall apply PAL speedup compensation?Answer:  Theoretically this is very possible.  As to practical application it is unknown if any current video players or flag/tag standard exists to accomplish this.  The digital video community has mostly tended to ignore this problem although something of the sort might exist by the time you read this.'''II. You can re-encode or convert PAL speedup videos back to NTSC with the correct audio pitch and playtime.'''There are different tools to accomplish this.  There are also some side effects such as the introduction of slight jerkiness in video from things like duplicated frames depending on the process you use. The sample rate of the audio needs to be changed so the audio is stretched to the correct playtime.  Then the video has to be stretched (which may involve the replication of frames) to match the audio runtime.Stretching the audio so that the audio tract is at the correct pitch and total length in runtime involves the formula calculated by ((24000/1001) / 25) * 48000.  Then the video can be stretched which involves extracting the video stream then a mux to put it back with the corrected audio stream. (1). Separate audio and video into 2 files. (2). process audio to correct pitch and runtime (3). process video to correct play length (4). mux correct audio and video into new file.For the audio track the process is lossy.  For the video track this depends on the software and method you use which may either introduce a slightly noticeable jerkiness in the video or some loss in quality.  From a video discussion forum a bash/shell script that uses ffmpeg: ffmpeg -loglevel info -y -i "$file" -map 0 -c copy -c:a ac3 -filter:a aresample=resampler=soxr,asetrate=46033.92 -ar 48000 tmp.mkv mkvmerge -o "$outfile" --default-duration 0:23.976fps tmp.mkvIn this person's example the change in video speed is lossless, only the metadata gets updated.  Here is another example: ffmpeg -i input.mkv -filter_complex "[0:V:0]setpts=25/24*PTS[vout];[0:a:0]asetrate=46080,aresample=resampler=soxr:osr=48k[aout]" -map "[vout]" -map "[aout]" -r:v 24/1 -vsync vfr output.mkvA new problem is introduced when you have subtitles.  If the subtitle track has already been timestamped to match the PAL video, the subtitles will lose synchronization with the newly corrected video.  This is especially troublesome with Forced Subtitles that are in their own track, like an srt embedded into an mkv file.  If the track is forced subtitles you might find that editing the timestamps in the file by hand with a text editor your only remedy.  This is less practical with a full line by line subtitle track.  Additional software is required or a clever bash script involving regex.  '''III. You can adjust the audio pitch and ignore the faster playtime (not recommended)'''.The audio file is not stretched, but processed so that the pitch is decreased to match the original pitch of the sound.  However, speech and audio will still be delivered faster than the original.  Imagine the actor being perceived as delivering a line faster than the original and yet not sounding higher pitched, just seeming to talk faster.  Human perception is not likely to notice the subtle time shift as long as the actor does not seem higher pitch in sound. 
Bureaucrat, administrator
14,711
edits