Log in

View Full Version : opening .rec file with avisynth


ahidayat
7th March 2009, 02:39
Hi everyone ....
i need a help for opening and extracting frames from a video file. i get this video file as a recorded window in a video conferencing software. the problem is that this video is in .rec file, which is not recognized by any video player/editor i've tried before. i would appreciate any help. i also need the avisynth script to open this file. Thanks

i'd like to attach the file here, unfortunately, the attachment manager states that this is invalid file.

poisondeathray
7th March 2009, 02:50
You can use a free hosting site e.g. mediafire.com , megaupload.com

mediainfo , gspot , and avinaptic may give you more information on the file

ahidayat
7th March 2009, 03:22
Thanks for the reply poisondeathray,
i've tried mediainfo and gspot, they just can tell me the number of frames and the codec, haven't used avinaptic.
here is the link for the .rec file http://www.mediafire.com/file/klwmkbnyyme/10m_source_zonevideo.rec.
would you or someone please have a look on it and give me some advice how i can extract frames from this file.
i need a help for using avysinth to open this file as well. thanks

Guest
7th March 2009, 04:09
they just can tell me the number of frames and the codec So what is the reported codec?

ahidayat
7th March 2009, 05:39
it is mpeg-4 visual

poisondeathray
7th March 2009, 07:39
You video conferencing software should have a player or encoding utilities manipulate the file

mplayer can play it, but it seems to be damaged, and without audio

I tried mencoder and ffmpeg to copy to avi, but it appears to be damaged; you might try an mplayer dump

ahidayat
7th March 2009, 08:15
Thanks poisondeathray, i actually need the video only, i don't need the audio from this file.
i want to measure the image quaility of this video, therefore i need to be able to extract frames of this video. the problem is, the software to measure the image quality doesn't recognize .rec file, so i can not use the player of video conferencing software. i then need to extract the video into individual images with either .bmp or .jpg extension, so that they can be recognized by the software to be analyzed.

i am kind of newbie here, would you please tell me what do you mean by mplayer dump ?

poisondeathray
7th March 2009, 15:42
I mean dumping the raw data , but your sample seems damaged and the output not playable

The best I could do with some recoverable frames was using mencoder

mencoder input.rec -oac copy -ovc copy -output.avi

You could take screenshots using an mplayer front end (e.g. smplayer) , as playing it in mplayer seems the least damaged

You should use the original software that the camera came with to find the proper splitter & decoder, because all the regular free/open source software seems to corrupt the image on decoding, so your image quality comparison would be useless anyway

Good Luck

poisondeathray
7th March 2009, 20:17
OK this works on my system:

1) Re-wrap your .rec file with ffmpeg (I'm using r16596 generic build from sourceforge) , re-wrap in .mov container (I renamed your file "input.rec" in this example). If you want a GUI for ffmpeg you can use avanti

ffmpeg -i input.rec -vcodec copy -acodec copy ouput.mov

2) Create an .avs with DirectShowSource. When checking the .mov file in graphstudio, I am using mp4splitter.ax 1.0.0.5, and ffdshow to decode xvid/divx. You can edit the avs script as you see fit in avsp, for example

DirectShowSource("output.mov")

3) I opened the .avs in vdub, and exported the 306 frames as .jpg for compression just as proof of concept (you could save as .png or .bmp for lossless instead for quality comparision)

http://www.megaupload.com/?d=EXXLSA7C

Cheers

ahidayat
8th March 2009, 00:02
Thanks poisondeathray, i'd like to try the way you do it. would you please tell me step by step how to make it works. first of all, i dont know where to type the scripts, such as ffmpeg -i input.rec -vcodec copy -acodec copy ouput.mov, then what tools/software i should prepare to make it works, also some terms that i don't know, such as ffmpeg, .avs, avsp, vdub, xvid/divx. however thank you very much, i really appreciate your help

poisondeathray
8th March 2009, 00:59
You're going to have to do some basic reading, there are guides and plenty of documentation out there. Google is a good search engine. To make this as easy as possible, only look up ffmpeg, forget about avisynth and the rest for now, you don't really need it if you just want to export some images

ffmpeg is a command line application, so you type that syntax at the command line. All this does is "repackage" the contents into a new container

FYI, the .avi container works as well, and is much nicer to use (It didn't work for me the 1st time for some reason, so I suggested .mov which worked). So all you do is type this at the command line (you would change the filenames to match):

ffmpeg -i input.rec -vcodec copy -acodec copy output.avi

This will give you a file "output.avi" that can be played in most media players. You can skip the avisynth step, and you can open that .avi file directly in virtualdub, then use file=>export=>image sequence and configure your options. You probably want .png or .bmp because they are lossless; jpeg will give you compression artifacts- no good if your goal is to compare quality

Good luck

EDIT: I suggested this earlier, but it might be easier for you to use Avanti, which is a GUI for ffmpeg, if you don't like using the command line. To set it up, you have to download a ffmpeg build and put it in the avanti ffmpeg directory. Then select copy video, copy audio, container avi, everything else like frame rate, frame size set to "source", then press start. Then continue with virtualdub as outlined above

ahidayat
8th March 2009, 22:04
Thanks poisondeathray, do you have any information about the easiest way to build ffmpeg in windows xp sp2. i follow the method in this link http://www.salyens.com/mingw/, but i'm stuck in this step ....
cd ffmpeg-0.4.7
patch --dry-run -p1 < ffmpeg-0.4.7.patch

the Msys always give me this error : sh: ffmpeg-0.4.7.patch: No such file or directory

do you have any suggestion? thanks

poisondeathray
8th March 2009, 22:07
Easiest way is just to download a generic build, you can use it immediately, no need to build:

http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632

dat720
8th March 2009, 22:23
the Msys always give me this error : sh: ffmpeg-0.4.7.patch: No such file or directory


This error means that the file 'ffmpeg-0.4.7.patch' is not in the same folder that you are running the command from, it is either in another folder or you have not downloaded it, or you have a typo in your command.

ahidayat
8th March 2009, 22:51
i.ve downloaded and unzipped the mplayer from the link http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632. however, when i double click the mplayer application, nothing happens. what should i do? thanks

LoRd_MuldeR
9th March 2009, 01:23
i.ve downloaded and unzipped the mplayer from the link http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632. however, when i double click the mplayer application, nothing happens. what should i do? thanks

It's a commandline application, so you need to run it from the Command Prompt (http://en.wikipedia.org/wiki/Windows_command_line) ;)

Or download MPlayer with a GUI front-end, like MPlayer for Windows:
http://mulder.dummwiedeutsch.de/home/?page=projects#mplayer

dat720
9th March 2009, 10:14
ahidayat, have you ever thought of reading the documentation??

If you had even done a little bit of research you'd know that mplayer is a command line application and requires either commands typed from a command prompt (Start | Run | cmd.exe before you ask), or a GUI or Frontend to interface with it.

Start here:
http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html

Then continue on here:
http://www.oesf.org/index.php?title=Mencoder_Encoding

poisondeathray
9th March 2009, 17:01
It's actually not mplayer/mencoder, but ffmpeg that was used above. The sourceforge page mistakenly has "Mplayer" in the title

This will be the third time I suggested this, but you might want to check out avanti, a GUI for ffmpeg. Just put the ffmpeg.exe into the ffmpeg folder.

dat720
9th March 2009, 21:49
either way, they are both command line apps, so my comments are still valid.

ffmpeg how to:
http://howto-pages.org/ffmpeg/

ahidayat
9th March 2009, 22:49
Thanks Poisondeathray, i finally can extract images from the .rec video. i have several questions, such as:
what is the meaning of "codec : copy video" in the avanti destination video setting. i need to keep the image/video quality in the output file exactly the same as the source file (no improvement nor degradation of the quality), how should i set the options in the avanti destination setting to realize this? and finally i have this error when converting .rec file :

:31:59 - Process started using FFmpeg SVN-r16596-Sherpya [ffmpeg].
======================================================================================
======================================================================================
+--------------------+
| |
Source [1] --> | FFmpeg | --> Destination [1]
| |
+--------------------+
======================================================================================

7:32:00 - Free space on destination disk 13,447 Mb.

FFmpeg messages/warnings:

[NULL @ 01724640]
... hmm, seems the headers are not complete, trying to guess time_increment_bits
[NULL @ 01724640]my guess is 1 bits ;)
[mpeg4 @ 01724640]
... hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 01724640]my guess is 1 bits ;)
[mpeg4 @ 01724640]
... looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 01724640]Error, header damaged or not MPEG4 header (f_code=0)
[mpeg4 @ 01724640]header damaged
[mpeg4 @ 01724640]
... hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 01724640]my guess is 15 bits ;)
[mpeg4 @ 01724640]
... hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 01724640]my guess is 15 bits ;)
[mpeg4 @ 01724640]
... looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
[mpeg4 @ 01724640]get_buffer() failed (-1 0 0 0)
[mpeg4 @ 01724640]picture size invalid (0x0)
... truncated (too many warnings), consider to cancel process.

7:32:01 - FourCC set to Default, frame rate to Source fps.
7:32:01 - Process finished after 00:00:01 hms with messages/warnings.

what do they mean, does it means that there are some quality degradation on the result ? Thanks

ahidayat
9th March 2009, 22:52
i have one more question, why the speed of the output video file is two or three times faster than the original .rec file when i play it in vlc player or windows media player. Thanks

poisondeathray
9th March 2009, 22:57
I have no idea. I can't even play that original .rec file in wmp or vlc - are you saying that you can? You probably have the codec installed from the software that came with the camera. If it plays in wmp, it means you have a directshow decoder that works for that file.

If so, try opening it up in avisynth using DirectShowSource() and use virtualdub to get your frames. All you do is install avisynth, open a text file, write DirectShowSource("file.rec"), change the extension from .txt to .avs. Open that .avs in virtualdub and use the same instructions listed above

ahidayat
10th March 2009, 09:34
i can play the .rec file in the media player comes from the video conference software, but i can't play it in either wmp or vlc. i've tried using avisynth as you said, but the file is not recognized by vlc. i open the .rec and .avi file in hex editor, and i see considerable difference between them. Do you know something to make both of them exactly identical ?. What about the error i get when converting the file, do you have the same experience ?
Thanks

poisondeathray
10th March 2009, 16:36
i have one more question, why the speed of the output video file is two or three times faster than the original .rec file when i play it in vlc player or windows media player. Thanks

You need a proper splitter/decoder combination, like the one that comes with your software. I am unfamiliar with that software - it probably doesn't install directshow filters, because you said it doesn't play in wmp. I have no idea if it's the same or different - I don't have that software! I only suggested avisynth because you previously said you could play it in wmp, but now you say you can't play it...

You might be able to use a lossless screen capture utility e.g. camtasia using lossless compression (e.g. lagarith) as you playback in your player, that might be the only way to be sure, but you need a fast enough HD or RAID, and CPU to be sure of not dropping frames. Either that or figure out a way for your camera software to integrate with directshow or avisynth.