Log in

View Full Version : NSV convertion to .....


themichael
9th April 2004, 19:07
Does anybody know if there is a method of converting NSV files to some other format?

bond
10th April 2004, 11:23
thats the nullsoft format

i assume if there is a tool which handles it, than winamp

themichael
11th April 2004, 07:51
There is talk about tools but nobody is posting links. Are there winamp police??

I did find this about the format:
http://home.pcisys.net/~melanson/codecs/nsv-format.txt

And a couple of posts about making "almost" streams using vp3 and mp3 codecs with virtualdub. But they weren't quite right.

There are also people using other codecs (Xvid) on the streams.

celtic_druid
11th April 2004, 08:20
http://www.nullsoft.com/nsv/nsvtools-setup.exe

Should be something there.

themichael
12th April 2004, 23:06
Those are "something to NVS" tools. Actually grabbed some of my webcam and capture card video with them. But I would like to go the other way.

I know the quality isn't all that great with these streams. I would like to share some of the strange stuff with a couple of my friends who are bandwidth challenged. VCDs are good enough.

Thanks to those who posted replies.

celtic_druid
13th April 2004, 04:40
I was under the impression that it contained a tool, demux.exe which as the name would imply could demux streams from NSV files.

Kurosu
15th April 2004, 02:45
I wrote some time ago a tool to demux nsv files to say, avi+mp3 (I haven't tested with aac content). I tried to add transmuxing to matroska, but file was unplayable; the avi file, the mp3 file and the avi+mp3 file from VDubMod played fine if I recall well. I don't remember in what state I left the code but here (http://kurosu.inforezo.org/NSVDemux.rar) it is. I suspect it to compile only with MS VC++ and maybe mingw/cygwin provided you have the proper headers. No binary included, no documentation.

Btw, the only win32 demux tool I found was only dumping the videostream without the slightest header. What is fine with MP3 stream isn't with a video codec, hence the need for an avi output.

themichael
16th April 2004, 20:03
Its been 18 years since I've had to compile code, guess I'll have to find a c++ compiler....

Thanks kurosu.

celtic_druid
17th April 2004, 04:54
If you get stuck, here is a compiled version:
http://www.aziendeassociate.it/cd//Misc/NSVDemux.7z

Not tested it though as I don't have any NSV files.

yedo1
17th April 2004, 14:29
I've tested little bit NSVD.exe compiled by celtic_druid.
NSVD.exe -n input.nsv -a video.avi -w audio.ext
will demux NSV stream.After that I can convert avi or mkv.
some NSV work fine but some had problem

VP61+mp3
tested with NTCast K-Pop at
http://61.74.71.103:11900/;stream.nsv
work fine.It can convert to VP6+mp3 AVI.

VP31+mp3
tested with XRM at
http://205.188.234.33:8048/;stream.nsv
and OHMYTRANCE at
http://211.39.130.125:8000/;stream.nsv
It can convert to VP3+mp3 AVI.But It can't seek.If seek it will freeze frame.

VP60+AAC
tested with Bjork 1M at
http://205.188.234.33:8010/;stream.nsv
It have sync problem and can't seek.

VP61+AAC
tested with Saltwaterchimp.com at
http://211.39.130.125:8000/;stream.nsv
same problem as above.

VP62+AAC
tested with NSV file encoded by myself
It can convert to VP6+AAC MKV.But can't seek.

Kurosu
17th April 2004, 16:20
I had tested with an VP6.1 video with MP3 audio. In order to make it seekable, programs must identify keyframes and mark them as such in the avi output. Such information is AFAIK unavailable in NSV. I found a byte identifying VP61 keyframes, but I haven't searched for other codecs, ie XviD. And I won't most probably, as it may depends on bitstream version, and may be written on only 1 bit.

Stux
17th April 2004, 22:19
When you remux an MPEG-4 bitstream into MP4 using the 3ivx DS Muxer, the keyframes are re-derived ;)

ie

NSV->AVI, AVI->MP4

(and then possible MP4->AVI)

will accomplish what you want

themichael
18th April 2004, 09:09
Thanks celtic_druid for the compile, but I get a program too large for memory error.

Found an old VC++ 6 disk. I get an OutputMatroska.cpp(180) : error C2065: 'MATROSKA_VERSION' : undeclared identifier error.

It's late here. Will try again tomorrow....

yedo1
18th April 2004, 12:36
VP3 and VP6 is not mpeg4 video,so can't use 3ivx DS muxer.

Kurosu
18th April 2004, 13:43
I took enough time to check with the above streams. Option -k often solved the problem:
- when you start recording a stream, you can't be sure first frame recorded will be a keyframe - so, untill the stream has one, the previous frames should be discarded
- a packet doesn't always start with a keyframe

However, there were still some problems, and I corrected the keyframe detection. Some tests I couldn't make:
- VP5 streams, as I don't have a proper decoder (I could try demuxing to avi+mp3, then remux to nsv, but that's too troublesome)
- VP6.2, as I don't have any stream

This detection is located in IsFrameKF function, InputFormat.cpp. You can add yourself detection this way:
- first use ds option to dump files for each frame (you can abort the process once the program dumped enough frames)
- use an hexa editor to check what common byte (or worse, bit) they have and then guess the 'keyframe proof'
or
- you already know from a standard like ISO MPEG-4 where this information is/how to extract it
then
- put in your own code once you know how to detect a keyframe

Example: for VP6.1, the 2nd byte of a video keyframe seems to always be '6'. So, within the IsFrameKF function, such a case was added:
case mmioFOURCC('V','P','6','1'):
Type = *(((unsigned char *)videobuf) + 1);
bIsKF = (Type == '6') ? true : false;
break;
I made the wild guess VP6.2 had the same proof. But 6.0, 5.0 and 3.1 seem to have their own proof.

Last but not least, I modified code+project so that:
- matroska support can be disabled. If you need it, you have to: Use libembl and libmatroska > 0.4.0 AFAIK (0.6.w works fine)
build libebml and libmatroska, move the produced libs into a path available to VC/mingw/... You can make a custom one, and add it definetely to your lib paths. The same must be done for the include path/files
Use the matroska build targets (the exe size is divided by 4 when not using matroska
- conflicts shouldn't arise anymore from the use of different runtimes for libmatroska and NSVDemux (ie Multithreaded vs singlethreaded). As a rule of thumbs, targets using matroska are MT, others are ST

Archive linked above was updated.

yedo1
19th April 2004, 13:18
Thanks kurosu.
I've tested my NSV files using VP61.some file have skipped after convert to mkv.

Is it possible convert mkv(VP6+AAC) or avi(VP3+mp3) files to nsv?

Kurosu
19th April 2004, 14:47
I think it's possible. However, I've got bad experience with Matroska (NSV to Matroska), and so it would be too much of a bother (time-wise) for me to extract streams from a Matroska file to a NSV file. AVI to NSV is more practical. Once the streams are available, it is possible to 'mux' to NSV, but I don't know what the requirements are (max packet size, bitrate, ...).

E-Male
19th July 2005, 05:49
is the source for nsvd still avaible somewhere or can someone post it again, please?

i'd like to add the vp62 keyframe detection

thx


for thos interested, these are the first bytes of some keyframes (the 7 biggest frames) :

72 47 0F 16 0F 16 3F 62 98
70 47 0F 16 0F 16 3F 62 97
72 47 0F 16 0F 16 3F 62 9C
70 47 0F 16 0F 16 3F 62 99
6A 47 0F 16 0F 16 3F 62 98
70 47 0F 16 0F 16 3F 62 98
6E 47 0F 16 0F 16 3F 62 A2

Sharktooth
19th July 2005, 12:07
http://www.nullsoft.com/nsv/nsvscsrc_031112.zip

E-Male
19th July 2005, 12:59
thx, but i meant the source code of Kurosu's demux tool

celtic_druid
26th July 2005, 18:43
I guess I would have it somewhere. I'll have a look later.

bugmenotwillyou
15th October 2005, 17:44
Not working for me. I get seperate audio and video files but neither are playable and virtualdub, tmpgenc do not recognize them.

celtic_druid
16th October 2005, 05:28
Try mencoder.