On Monday 25 August 2003 21:01, Ronald Bultje wrote:
> If I'm correct, using a --nodeps should work. We don't specifically need
> it. I just added it so that normal people will understand that they can
> get quicktime support by this.

It probably would work just fine, but I'm not only lazy; I'm a coward, too. :)

> > The max-file-time (like max-file-size but with time) feature didn't make
> > it?
>
> Oh, yeah, go ahead and apply it if you want. :).

Okely-dokely-diddley-do!

Well, I ported my changes from 1.6.0 and renamed the argument to be more 
consistent with the existing max-file-size. I hope the attached diff files 
aren't too messed up. (I still haven't learned that diff/patch thing...)

They're diffed against the latest 1.6.1.90 sources. I believe the biggest 
change is an added field in lavrec_t, holding the number of frames.

I chose to implement it as number of frames per file, rather than number of 
seconds per file because the NTSC framerate wouldn't let you specify exactly 
10000 frames, a number I find very convenient as a per-file-limit.

/Sam
*** mjpegtools-1.6.1.90/lavtools/orig-lavrec.c	Sat Aug 23 15:14:35 2003
--- mjpegtools-1.6.1.90/lavtools/lavrec.c	Mon Aug 25 23:53:21 2003
***************
*** 99,104 ****
--- 99,110 ----
   *      format and need a specific filesize limit, for example to be
   *      able to burn the video files to CD (650 MB).
   *
+  *   --max-file-frames --- The maximum number of frames per video file
+  *      Intended for those that would like to record video in MJPEG
+  *      format and need a specific number of frames per file, for
+  *      example to be able to perform easy file and frame number
+  *      arithmetics when cutting video manually.
+  *
   *   --file-flush  --- How often (in frames) the current output 
   *       file (if any) should be flushed to disk.  (default:60).
   *       Set to 0 if your chosen file-system and system tuning
***************
*** 253,258 ****
--- 259,265 ----
  	fprintf(stderr, "  --software-encoding         Use software JPEG-encoding (for BTTV-capture)\n");
  	fprintf(stderr, "  --num-procs num             Number of encoding processes (default: 1)\n");
  	fprintf(stderr, "  --max-file-size num         Maximum size per file (in MB)\n");
+ 	fprintf(stderr, "  --max-file-frames num       Maximum number of frames per file\n");
  	fprintf(stderr, "  --file-flush num            Flush capture file to disk every num frames\n");
  
  	fprintf(stderr, "  -v/--verbose [012]          verbose level (default: 0)\n");
***************
*** 842,847 ****
--- 849,858 ----
  	{
  		info->max_file_size_mb = atoi(optarg);
  	}
+ 	else if (strcmp(name, "max-file-frames")==0)
+ 	{
+ 		info->max_file_frames = atoi(optarg);
+ 	}
  	else if (strcmp(name, "file-flush")==0)
  	{
  		info->flush_count = atoi(optarg);
***************
*** 888,893 ****
--- 899,905 ----
  		{"software-encoding",0,0,0},   /* --software-encoding    */
  		{"num-procs"        ,1,0,0},   /* --num-procs            */
  		{"max-file-size"    ,1,0,0},   /* --max-file-size        */
+ 		{"max-file-frames"  ,1,0,0},   /* --max-file-frames      */
  		{"file-flush"       ,1,0,0},   /* --file-flush           */
  		{"frequency"        ,1,0,0},   /* --frequency/-F         */
  		{0,0,0,0}
*** mjpegtools-1.6.1.90/lavtools/orig-liblavrec.c	Mon Aug 25 23:10:48 2003
--- mjpegtools-1.6.1.90/lavtools/liblavrec.c	Mon Aug 25 23:13:13 2003
***************
*** 618,623 ****
--- 618,629 ----
     }
  
     /* Check if we have to open a new output file */
+    if( info->max_file_frames > 0 &&  settings->stats->num_frames % info->max_file_frames == 0)
+    {
+       lavrec_msg(LAVREC_MSG_INFO, info,
+          "Max number of frames reached, opening next output file");
+       OpenNewFlag = 1;
+    }
     if (settings->output_status > 0 && (settings->bytes_output_cur>>20) > info->max_file_size_mb)
     {
        lavrec_msg(LAVREC_MSG_INFO, info,
*** mjpegtools-1.6.1.90/lavtools/orig-liblavrec.h	Mon Aug 25 23:14:24 2003
--- mjpegtools-1.6.1.90/lavtools/liblavrec.h	Mon Aug 25 23:16:25 2003
***************
*** 111,116 ****
--- 111,117 ----
     char **files;                /* the files where to capture the video to */
     int  num_files;              /* number of files in the files[]-array */
     int max_file_size_mb;
+    int max_file_frames;         /* maximum number of frames per file */
     int flush_count;             /* How often (in frames) to flush data to disk */
     void (*output_statistics)(video_capture_stats *stats);      /* speaks for itself */
     void (*audio_captured)(uint8_t *audio, long sampes);           /* callback when audio has been grabbed */

Reply via email to