FORUM

FORUM



SearchSearch   Users   Registration   Entrance
Today: 04.04.2026 - 14:33:42
Pages:  1  2  

If I add a fprintf in the encoding source....

AuthorMessage

StevzZ3

usr


Statistics:
Messages: 24
Registration: 10.24.2002

Hello! I am currently exploring XVID for my project. Being new in the area of encoders and decoders I would like to ask a question: Let's say I would like to edit the bitstreamputbits() function to write the bitstream to a file. The thing I am not sure about is if this were possible. That is because, if virtual dub were to use xvid to encode a movie, will the fprintf function work along side it? (This means during encoding, a file which i specified will be written as well with the bits I want). Not sure if i made myself clear!


---------------------
2000 Z3 2.8 Schwarz II x III
Message # 1 12.10.22 - 17:13:02
RE: If I add a fprintf in the encoding source....

113

usr


Statistics:
Messages: 10.09.2001
Registration:

Hey Thanks Nic! I am not proficient enough in C. fprintf only writes a text file? fwrite writes a binary file i suppose? Anyway, how do you guys test the source code once u edited the code? Meaning, if i edited the code, do i install the xvid.inf file again? It will overwrite the old one? And if i want to have different test versions? static void __inline BitstreamPutBit(Bitstream * const bs, const uint32_t bit) { if (bit) bs->buf


---------------------
roc64
Message # 2 12.10.22 - 17:21:05
RE: If I add a fprintf in the encoding source....

Bart C

usr


Statistics:
Messages: 47
Registration: 04.13.2002

If all you want to do is capture the output of the encoder, why not edit the vfw code instead? All xvidcore does is write all its output to a buffer supplied by vfw, then vfw returns that buffer to the calling application (VDub then writes it to an AVI file). If you wrote out the contents of frame.bitstream (the length of which is frame.length) in vfw/src/codec.c -> compress() you'd achieve the same thing, and it'd work a lot faster than individual writes for every bitstring. And it'd save you a lot of trouble :) -h


---------------------
A good friend will bail you out of jail... But your BEST friend will be the one sitting next to you, saying; "That was freaking awesome!"
Message # 3 12.10.22 - 17:28:53
RE: If I add a fprintf in the encoding source....

J.Snow

usr


Statistics:
Messages: 425
Registration: 11.05.2003

Editing the VFW's code is pretty new. So i will just fwrite the frame.bitstream from the compress() function of codec.c ? And if i wanted to write lets say 1 megabyte to each file (A 10 meg file produces 10 files etc). Is that still possible with VFW? If it were possible. How then can i decode? Is it with VFW too?



Message # 4 12.10.22 - 17:34:54
RE: If I add a fprintf in the encoding source....

Bart C

usr


Statistics:
Messages: 47
Registration: 04.13.2002

What is the end goal of this project? There are probably easy ways to solve the entire problem, instead of creating extra work at every step. -h


---------------------
A good friend will bail you out of jail... But your BEST friend will be the one sitting next to you, saying; "That was freaking awesome!"
Message # 5 12.10.22 - 17:44:35
RE: If I add a fprintf in the encoding source....

jesd325is

usr


Statistics:
Messages: 2,475
Registration: 08.18.2001

The end goal is pretty experimental like. The idea is to speed up streaming. Just like how download accelerator and other download managers do it. Segment the file and download from different servers. Similarly, I want to apply it to video but perhaps on a frame by frame basis. So 10 consecutive frames are each stored in separate files. So file 1 has frame 1, 11 , 21 etc etc. That is my main purpose. But the thing is all frames have different sizes. Not sure if i can write each frame to each file. What do u suggest? Streaming function will be implement in the decoder( i suppose) and will just get the 10 different files from the 10 different servers.


---------------------
M3 cams *UUC stage II lwfw w////M5 clutch *JC cam & lwfw chip *ECIS intake *Bosal cat back *UUC udp's *M3 3.15lsd *M3 shifter *H&R & Bilstein sport *E46 M3 rsm *Z3 rein4c plates *Depo DDE's *Zender lp *M3 spoiler *M3 moldings * M3 mirrors *billetwerk
Message # 6 12.10.22 - 17:49:37
RE: If I add a fprintf in the encoding source....

dave is cool

usr


Statistics:
Messages: 6,780
Registration: 04.25.2003

I have got another question. If I were to write the bitstream from bitstream.h in the bitstreamputbit(), will this binary file of bitstream be playable in windows media player? Or do I have to do it in the VFW's source?



Message # 7 12.10.22 - 17:57:04
RE: If I add a fprintf in the encoding source....

!WriteFile(codec->twopass.hints, frame.hint.hintstream, blocksize, &wrote, 0)

usr


Statistics:
Messages:
Registration: wrote != sizeof(int)

Yes, load balancing as well! So it would be easier to tap from "LRESULT compress(CODEC * codec, ICCOMPRESS * icc)" in codec.c of vfw. For each time the compress() function is called, it is one entire frame with its auxilliary information? Are frame.length, frame.bitstream the only things i need to write to? Which part of the function does it write these info? if (!WriteFile(codec->twopass.hints, &frame.hint.hintlength, sizeof(int), &wrote, 0)



Message # 8 12.10.22 - 18:07:13
RE: If I add a fprintf in the encoding source....

bcart1991

usr


Statistics:
Messages: 5,587
Registration: 08.19.2003

Hey -h, I read the code for VFW, it prepares the video for writing by virtualDub and understood a little. Let me paint the impression in my mind: frame.bitstream in compress() now has the output compressed data to write. frame.length has the size of the compressed data However, how about things such as flags for the AVI index? Must they be written too? What else are they? Any order of writing? I have inserted this code: outfile = fopen("test.dat", "a+"); fwrite(frame.bitstream, sizeof(BITMAPINFOHEADER), frame.length, outfile); VirtualDub would crash! Think something is wrong but cant figure out where! Please help!:confused:


---------------------
KOTTER
Message # 9 12.10.22 - 18:18:16
RE: If I add a fprintf in the encoding source....

BlkDinanM3

usr


Statistics:
Messages: 193
Registration: 10.03.2003

Hi! I have never used Linux before and was wondering after you "make" the xvid codec, do you still have to use a third party program like virtual dub to encode or will you produce a .exe file as the encoder?



Message # 10 12.10.22 - 18:28:53
RE: If I add a fprintf in the encoding source....
Headphone Mixes : Previous topicNext topic: another 8 I/Os ?
Pages:  1  2  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants

Forum powered by: IP.Board © 2025 5.0.6