View Full Version : Cutting Avi fails with UYVY
Kartificial
8th February 2012, 22:50
Hi all,
I'm cutting an avi file in pieces which is an easy task for AviSynth, but something gets screwed up. The file is a recording from a camera that recorded in UYVY pixel format which i think is the main problem here. The chopping goes wel, but the resulting video looks as if there are multiple frames displayed at once with almost entirely black frames every now and then.
I tried using RawSource to load the file but nothing seems to work.
Any ideas where things go wrong?
poisondeathray
8th February 2012, 22:52
post more information on the video file or camera . Is video in a container? How is it stored? on media?
try mediainfo
http://mediainfo.sourceforge.net/en
Kartificial
8th February 2012, 22:58
Thanks for the quick reply. Here is more info:
[Container and general information]
AVI (OpenDML): 2.85 GiB, 1h 0m
1 video stream: MS Video
1 audio stream: PCM
[First video stream]
5327 Kbps, 720*576 (5:4), at 25.000 fps, MS Video (PAL)
[First audio stream]
1411.2 Kbps, 44.1 KHz, 16 bits, 2 channels, PCM (Little / Signed)
Hope this helps.
poisondeathray
8th February 2012, 23:02
MS video is not uncompressed, you can load it with AVISource() with FFDShow installed (enable MS Video in the VFW configuration - I'm assuming it's MSS1 or MSS2) , or with FFVideoSource/FFAudioSource
Can you run the file through gspot and see what it says?
Note, cutting with avisynth requires re-encoding - because it decompresses - you are frameserving uncompressed video
So depending on what you want to do, something like cutting in vdub might be better
Kartificial
9th February 2012, 00:23
I installed FFDShow, not really sure how to use it in combination with AviSynth as you suggested. I tried adding ffshow("default") in my AviSynth script, but no results.
GSpot says:
[Video]
Codec: CRAM, Name: Microsoft Video 1
Status: Codec(s) installed
[Audio]
Codec: PCM Audio
Status: No Codec required
[Container]
File Length Correct
Multipart OpenDML Avi (3 parts)
(90062 frames in first part, -66 frames follow)
When I test the video/audio in GSpot, it looks fine.
poisondeathray
9th February 2012, 00:31
enable fourcc "CRAM" or MS Video 1 in the ffdshow vfw configuration, push apply, and it will open in vdub, or with AVISource("video.avi") in avisynth
If it already renders ok in gspot and it says codecs installed, you probably already have at least directshow filters for it, but you need VFW filters for it to open in vdub or AVISource()
Kartificial
9th February 2012, 00:46
Hmm interesting, I have the decoder codec for CRAM set the libavcodec (only option besides disabled) and still no change whatsoever.
I looked more closely at what exactly happens in the resulting file in AviSynth. It looks as if frames are repeated in reverse while the rest continues.
poisondeathray
9th February 2012, 00:51
did you change the avs script to avisource() ? post your full script
what happens if you open the file directly in vdub ? are frames repeated ?
with the video loaded directly in vdub, use file=> file information and report what decoder is being used
what happens in a media player like vlc ? If it plays ok there you can probably use ffmpegsource2 to open it in avisynth
Kartificial
9th February 2012, 01:04
did you change the avs script to avisource() ? post your full script
The script is this:
AviSource("record-7.avi")
Trim(1500, 3000) ++ Trim(7500, 9000)
When is leave the Trim function out, it just output the original file but screwed up.
what happens if you open the file directly in vdub ? are frames repeated?
When i open the original file in VDub i get a few warnings (just like when i open it in VLC when it says the file is broken but when i don't fix it, it works fine).
The warnings is about the fact that the file has a non-zero start position of 50 samples (+2000 ms).
The file plays fine after this.
with the video loaded directly in vdub, use file=> file information and report what decoder is being used
Decompressor: Microsoft Video 1 (CRAM), so the right one i guess.
what happens in a media player like vlc ? If it plays ok there you can probably use ffmpegsource2 to open it in avisynth
Like i said above, it says the file needs fixing (probably due to the non-zero start position) but when i ignore this, it plays fine.
P.S. Thanks for the help so far! :)
poisondeathray
9th February 2012, 01:09
So is it possible video file is damaged? maybe bad transfer from the camera or from recording media to PC ? Do you have another copy ?
You can try different source filter/decoder , ffmpegsource2, but it will probably give same errors
Or if it plays fine in vdub after you ignore the errors, you can try re-wrapping it into another AVI (use direct stream copy for video & audio), maybe problem with that container ?
Or you can encode to a lossless compressed AVI in vdub since it plays fine there e.g. lagarith , but you haven't described what you're trying to do exactly ? What kind of edits? What end format goal?
Kartificial
9th February 2012, 08:33
So is it possible video file is damaged? maybe bad transfer from the camera or from recording media to PC ? Do you have another copy ?
You can try different source filter/decoder , ffmpegsource2, but it will probably give same errors
Or if it plays fine in vdub after you ignore the errors, you can try re-wrapping it into another AVI (use direct stream copy for video & audio), maybe problem with that container ?[q/qu
Or you can encode to a lossless compressed AVI in vdub since it plays fine there e.g. lagarith , but you haven't described what you're trying to do exactly ? What kind of edits? What end format goal?
Well, There are recorded live from a camera and directly stored on the computer. So i only have 1 version. I fixed the file by rewrapping it, but it makes no difference when using AviSynth thereafter.
The thing i need to do is as follows. I have a bunch (around 80) videofiles of around 1 hour which i need to edit. I need to cut out several scenes (not sure how much, but alot) and paste them into one movie. Afterwards, I want to burn it on (several) DVDs so I can send it to a foreign country.
The thing is that cutting all the files by hand is a load of work and i figured it had to be possible to automate this, as I found out is possible in AviSynth.
I will try your other suggestions as soon as I get the possibility.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.