colinb
1st April 2005, 21:51
I have used Avisyth only briefly a couple of years ago, so I'm a bit of a novice. Is it possible to do the following with Avisynth? I'll explain the reason for this afterwards.
I need to open two separate .mpv files and skip forward to a particular hh:mm:ss.ff (a different value for either file). I then need to read a frame from file 1 and file 2, placing the frame from file 1 in a fully-opaque layer on top of the frame from file2. I then want to punch a rectanglar hole in the top layer so that the bottom layer shows through the hole. Then flatten to a single layer and write the resulting frame to an uncompressed video output AVI file. Then take the next frame from both input files and repeat the above for N frames.
The colour space needs to be kept constant throughout all of this.
The resaon why I want to do this is that I have a good quality recording of a DVB-T broadcast but in a couple of places the signal was corrupted leaving about 15 frames with large pixelated areas on those frames.
Fortunatley that program was repeated a few days later, but it was at a much lower bitrate and had a channel logo in the top left corner. The original program did not have any pixelation at the top left.
I therefore thought it would be a good idea to take a frame from the lower quality repeat show and layer it on top of the corresponding corrupted frame from the original show. Then punch a hole in the top layer around the logo which would leave the logo-free area showing through. I could use this "repaired" sequence of frames to replace the damaged ones in the original MPEG file. The 15 frames would be of lower quality because it would have gone through an extra encoding to MPEG2, but it looks a lot more pleasant than the pixelation.
I tried taking bitmap snapshots of each frame and layering them manually in Photoshop and it seemed to work well, but when I inserted the repaired frames into the original file there was a difference in colour saturation compared to the original - I assume that this was because the color space was changed to RGB when the snapshot was taken and then back to the MPEG2 color space again. So I guess I need to keep the whole procedure in the MPEG2 color space throughout.
Then I thought of Avisynth. The above procedure is so mechanical that AviSynth might be an ideal solution.
Is it possible to do this in AviSynth?
Thanks
I need to open two separate .mpv files and skip forward to a particular hh:mm:ss.ff (a different value for either file). I then need to read a frame from file 1 and file 2, placing the frame from file 1 in a fully-opaque layer on top of the frame from file2. I then want to punch a rectanglar hole in the top layer so that the bottom layer shows through the hole. Then flatten to a single layer and write the resulting frame to an uncompressed video output AVI file. Then take the next frame from both input files and repeat the above for N frames.
The colour space needs to be kept constant throughout all of this.
The resaon why I want to do this is that I have a good quality recording of a DVB-T broadcast but in a couple of places the signal was corrupted leaving about 15 frames with large pixelated areas on those frames.
Fortunatley that program was repeated a few days later, but it was at a much lower bitrate and had a channel logo in the top left corner. The original program did not have any pixelation at the top left.
I therefore thought it would be a good idea to take a frame from the lower quality repeat show and layer it on top of the corresponding corrupted frame from the original show. Then punch a hole in the top layer around the logo which would leave the logo-free area showing through. I could use this "repaired" sequence of frames to replace the damaged ones in the original MPEG file. The 15 frames would be of lower quality because it would have gone through an extra encoding to MPEG2, but it looks a lot more pleasant than the pixelation.
I tried taking bitmap snapshots of each frame and layering them manually in Photoshop and it seemed to work well, but when I inserted the repaired frames into the original file there was a difference in colour saturation compared to the original - I assume that this was because the color space was changed to RGB when the snapshot was taken and then back to the MPEG2 color space again. So I guess I need to keep the whole procedure in the MPEG2 color space throughout.
Then I thought of Avisynth. The above procedure is so mechanical that AviSynth might be an ideal solution.
Is it possible to do this in AviSynth?
Thanks