On Wednesday 04 February 2004 12:30, Steven M. Schultz wrote:
> I see nothing in that proceedure that removes the YUV4MPEG2 header
> bits. How are you doing that?
I didn't show that. Not being as clever as you, I wrote a subroutine in C to do it.
Your scripting is a much better idea!
void snip(void)
{
char yuv_format[10], yuv_width[10], yuv_height[10], yuv_frame[10], yuv_flags[10],
yuv_aspect[10];
long whereAmI;
strcpy(open_here, vcd_root_v);
strncat(open_here, f_name , strlen(f_name));
strncat(open_here, as_this , strlen(as_this));
dump=malloc(f_size());
if ((cfptr = fopen(open_here,"r"))==NULL)
{
printf("ERROR opening source file\n");
return;
}
else
{
fscanf(cfptr, "%s %s %s %s %s %s\n", yuv_format, yuv_width, yuv_height,
yuv_frame, yuv_flags, yuv_aspect);
var1 = fseek(cfptr,(long)0, SEEK_CUR);
whereAmI=ftell(cfptr);
var1 = fread(dump, 1, size_of_file, cfptr);
fclose(cfptr);
if ((cfptr = fopen(open_here,"w"))==NULL)
{
printf("ERROR in replacing file\n");
}
else
{
var1 = fwrite(dump, 1, size_of_file-whereAmI, cfptr);
fclose(cfptr);
}
}
free(dump);
return;
}
> read junk
Does junk refer to stdio in this case?
> Why? Because the shell redirection ('> sum.y4m') is done FIRST and
Doh!
> I suspect that is not the desired result ;)
You are correct.
> And the 'lav2yuv' commands can be arbitrarily complex - each segment
> could be run thru it's own yuvdenoise, or any other filter than
> emits a Y4M stream on stdout.
> (lav2yuv file1 ...; \
> lav2yuv file2 ... | skip1.sh; \
> lav2yuv file3 ... | skip1.sh) | mpeg2enc ...
So the only limitation of this method is ARG_MAX?
(There are quite a few files I plan to process --both JPEGs and AVIs)
> THAT's my approach - not creating the large intermediate files and
> manually stripping off the header and cat'ing the files together :)
It's and excellent approach --certainly better than mine.
> be removed. At least that was the problem someone else had - they
> were accidentally removing a little too much from the front of the
Yes. That might have been me. But that problem was corrected in your former
clarification.
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users