DOSBox Feature Request Thread

General information and assistance with DOSBox.

Re: DOSBox Feature Request Thread

Postby junglemontana » 2019-10-08 @ 08:29

Kisai wrote:There is a feature in dosbox-x that should be backported to dosbox. OpenDML (AVI 2.0) avi support. I actually have a diff between r4000 and dosbox-x's files for that somewhere, but basically the issue is that if you're recording the video using the internal recording mechanism, if it hits the file size limit (2GB), the avi file is completely unusable. I originally worked around it just by having it stop and immediately restart the recording every X frames, which was more of a bandaid workaround than a true fix.

Unfortunately that diff is against an older version of dosbox, and not vanilla dosbox. Not a trivial change, but it touches the avi writer and wav writer in the process.


I agree that this would be useful. However, a modern format such as MKV would be even better.
junglemontana
Newbie
 
Posts: 44
Joined: 2019-2-16 @ 17:37

Re: DOSBox Feature Request Thread

Postby awgamer » 2019-10-08 @ 13:03

https://www.howtogeek.com/200736/what-i ... play-them/

>How Can I Play MKV Files?

>Because MKV isn’t an industry standard, not all media players support it..

Yeah, no.
awgamer
Oldbie
 
Posts: 575
Joined: 2014-7-26 @ 07:42

Re: DOSBox Feature Request Thread

Postby jmarsh » 2019-10-08 @ 13:44

Most DOSBox recordings need to be edited afterwards and there's not a lot of support for editing Matroska, plus the only way to store ZMBV data in it would be to use VFW codec mode which gives no benefits over AVI.
jmarsh
Member
 
Posts: 333
Joined: 2014-1-04 @ 09:17

Re: DOSBox Feature Request Thread

Postby Kisai » 2019-10-08 @ 15:58

jmarsh wrote:Most DOSBox recordings need to be edited afterwards and there's not a lot of support for editing Matroska, plus the only way to store ZMBV data in it would be to use VFW codec mode which gives no benefits over AVI.


I looked at this and other containers before and basically only VFW AVI is suitable to store dosbox data because it's frame-based. OpenDML just works-around the signed 32-bit file size (2GB) by just making additional indexes more or less. The dosbox-x code (at least 32-bit) seems to solve the "dosbox has overflowed the 2GB limit" by instead just making everything after 2GB quasi-playable (eg you can't seek to it, and ffmpeg can't read it past 2GB and assume it ends at 2GB.) Not really that much of an improvement, but better than the status quo which makes the entire video unusable the second it hits 2GB. So it's still buggy. I did however make an improvement to the original work around in this case

Note this is using the dosbox-x opendml code already applied, but this is essentially how I solve the file size limit
Code: Select all
      /* Everything went okay, set flag again for next frame */
      CaptureState |= CAPTURE_VIDEO;
      //Break AVI files at 1GB by resetting video stream
      //UINT64 maxvideosize = 0x3FF00000ULL;
       
      if ((uint64_t)capture.video.writer->riff->top->write_offset >= maxfilesizemb) {
         LOG_MSG("Reset of captured video due to over maximum video size.");
         goto skip_video;
      }
      
   }

   return;
skip_video:
   avi_writer_end_data(capture.video.writer);
   avi_writer_finish(capture.video.writer);
   avi_writer_close_file(capture.video.writer);
   capture.video.writer = avi_writer_destroy(capture.video.writer);
#endif
   return;
}


Basically telling dosbox to close the capture as soon as it's near 2GB (in this case I used 1GB just to make the file sizes more manageable) by a configuration variable. Because the flag isn't reset, Dosbox opens a new file at the next frame, thus no capture data is lost and is essentially identical to hitting the capture button twice at the end of the same frame.

Another thing that does need to happen, but this requires making a different change to dosbox that I haven't looked into, is to make sure that the video is properly closed when dosbox is closed, because that's the other reason why the video ends up unusable.
Kisai
Member
 
Posts: 138
Joined: 2010-5-05 @ 08:04

Re: DOSBox Feature Request Thread

Postby Akuma » 2019-10-16 @ 16:18

option (on/off) to automatically release the mouse cursor when entering debugger.
now i have to press, debugger hotkey and then ctrl+f10 to get my mouse back.

thank you :D
Akuma
Newbie
 
Posts: 80
Joined: 2019-7-24 @ 14:47

Re: DOSBox Feature Request Thread

Postby collector » 2019-10-16 @ 23:57

Or just set autolock to false.
User avatar
collector
l33t
 
Posts: 4400
Joined: 2003-1-15 @ 10:39

Re: DOSBox Feature Request Thread

Postby Akuma » 2019-10-17 @ 11:31

Yeee, fastest implementation yet :D
Akuma
Newbie
 
Posts: 80
Joined: 2019-7-24 @ 14:47

Re: DOSBox Feature Request Thread

Postby Grunt » 2019-12-02 @ 17:31

Kisai wrote:I looked at this and other containers before and basically only VFW AVI is suitable to store dosbox data because it's frame-based. OpenDML just works-around the signed 32-bit file size (2GB) by just making additional indexes more or less.

Heretical idea: It is really necessary to fit recorded video into AVI? Cannot be fitted in RAW form (or ZMBV form or whatever it is) directly into some pipe with ffmpeg on another side of pipe? Today multicore computers can recode video on-the-fly withou hiccups.
Just look at it:
Code: Select all
      Bit8u avi_header[AVI_HEADER_SIZE];
      Bitu main_list;
      Bitu header_pos=0;
#define AVIOUT4(_S_) memcpy(&avi_header[header_pos],_S_,4);header_pos+=4;
#define AVIOUTw(_S_) host_writew(&avi_header[header_pos], _S_);header_pos+=2;
#define AVIOUTd(_S_) host_writed(&avi_header[header_pos], _S_);header_pos+=4;
      /* Try and write an avi header */
      AVIOUT4("RIFF");                    // Riff header
      AVIOUTd(AVI_HEADER_SIZE + capture.video.written - 8 + capture.video.indexused);
      AVIOUT4("AVI ");
      AVIOUT4("LIST");                    // List header
      main_list = header_pos;
      AVIOUTd(0);                        // TODO size of list
      AVIOUT4("hdrl");

      AVIOUT4("avih");
      AVIOUTd(56);                         /* # of bytes to follow */
      AVIOUTd((Bit32u)(1000000 / capture.video.fps));       /* Microseconds per frame */
      AVIOUTd(0);
      AVIOUTd(0);                         /* PaddingGranularity (whatever that might be) */
      AVIOUTd(0x110);                     /* Flags,0x10 has index, 0x100 interleaved */
      AVIOUTd(capture.video.frames);      /* TotalFrames */
      AVIOUTd(0);                         /* InitialFrames */
      AVIOUTd(2);                         /* Stream count */
      AVIOUTd(0);                         /* SuggestedBufferSize */
      AVIOUTd(capture.video.width);       /* Width */
      AVIOUTd(capture.video.height);      /* Height */
      AVIOUTd(0);                         /* TimeScale:  Unit used to measure time */
      AVIOUTd(0);                         /* DataRate:   Data rate of playback     */
      AVIOUTd(0);                         /* StartTime:  Starting time of AVI data */
      AVIOUTd(0);                         /* DataLength: Size of AVI data chunk    */

      /* Video stream list */
      AVIOUT4("LIST");
      AVIOUTd(4 + 8 + 56 + 8 + 40);       /* Size of the list */
      AVIOUT4("strl");
      /* video stream header */
        AVIOUT4("strh");
      AVIOUTd(56);                        /* # of bytes to follow */
      AVIOUT4("vids");                    /* Type */
      AVIOUT4(CODEC_4CC);                  /* Handler */
      AVIOUTd(0);                         /* Flags */
      AVIOUTd(0);                         /* Reserved, MS says: wPriority, wLanguage */
      AVIOUTd(0);                         /* InitialFrames */
      AVIOUTd(1000000);                   /* Scale */
      AVIOUTd((Bit32u)(1000000 * capture.video.fps));              /* Rate: Rate/Scale == samples/second */
      AVIOUTd(0);                         /* Start */
      AVIOUTd(capture.video.frames);      /* Length */
      AVIOUTd(0);                  /* SuggestedBufferSize */
      AVIOUTd(~0);                 /* Quality */
      AVIOUTd(0);                  /* SampleSize */
      AVIOUTd(0);                  /* Frame */
      AVIOUTd(0);                  /* Frame */
      /* The video stream format */
      AVIOUT4("strf");
      AVIOUTd(40);                 /* # of bytes to follow */
      AVIOUTd(40);                 /* Size */
      AVIOUTd(capture.video.width);         /* Width */
      AVIOUTd(capture.video.height);        /* Height */
//      OUTSHRT(1); OUTSHRT(24);     /* Planes, Count */
      AVIOUTd(0);
      AVIOUT4(CODEC_4CC);          /* Compression */
      AVIOUTd(capture.video.width * capture.video.height*4);  /* SizeImage (in bytes?) */
      AVIOUTd(0);                  /* XPelsPerMeter */
      AVIOUTd(0);                  /* YPelsPerMeter */
      AVIOUTd(0);                  /* ClrUsed: Number of colors used */
      AVIOUTd(0);                  /* ClrImportant: Number of colors important */

      /* Audio stream list */
      AVIOUT4("LIST");
      AVIOUTd(4 + 8 + 56 + 8 + 16);  /* Length of list in bytes */
      AVIOUT4("strl");
      /* The audio stream header */
      AVIOUT4("strh");
      AVIOUTd(56);            /* # of bytes to follow */
      AVIOUT4("auds");
      AVIOUTd(0);             /* Format (Optionally) */
      AVIOUTd(0);             /* Flags */
      AVIOUTd(0);             /* Reserved, MS says: wPriority, wLanguage */
      AVIOUTd(0);             /* InitialFrames */
      AVIOUTd(4);    /* Scale */
      AVIOUTd(capture.video.audiorate*4);             /* Rate, actual rate is scale/rate */
      AVIOUTd(0);             /* Start */
      if (!capture.video.audiorate)
         capture.video.audiorate = 1;
      AVIOUTd(capture.video.audiowritten/4);   /* Length */
      AVIOUTd(0);             /* SuggestedBufferSize */
      AVIOUTd(~0);            /* Quality */
      AVIOUTd(4);            /* SampleSize */
      AVIOUTd(0);             /* Frame */
      AVIOUTd(0);             /* Frame */
      /* The audio stream format */
      AVIOUT4("strf");
      AVIOUTd(16);            /* # of bytes to follow */
      AVIOUTw(1);             /* Format, WAVE_ZMBV_FORMAT_PCM */
      AVIOUTw(2);             /* Number of channels */
      AVIOUTd(capture.video.audiorate);          /* SamplesPerSec */
      AVIOUTd(capture.video.audiorate*4);        /* AvgBytesPerSec*/
      AVIOUTw(4);             /* BlockAlign */
      AVIOUTw(16);            /* BitsPerSample */
      int nmain = header_pos - main_list - 4;
      /* Finish stream list, i.e. put number of bytes in the list to proper pos */

Bonus:
  • No 2GB filesize limit
  • No waiting for encoding into different format
  • Pipe closed? No data? No problem for ffmpeg.
BTW: Where exactly goes MIDI data when recording? Video recording works perfectly but is without music. Just Sound Blaster.
User avatar
Grunt
Newbie
 
Posts: 5
Joined: 2019-7-05 @ 17:19
Location: Europe

Re: DOSBox Feature Request Thread

Postby jmarsh » 2019-12-03 @ 01:20

You couldn't just shove frames down a pipe, you'd need some way to communicate the frame rate/sampling rate, resolution, frame delimiters... once you've done all that you've basically recreated AVI.

DOSBox only records audio that goes through its mixer, if you're using an external midi device the output won't be recorded.
jmarsh
Member
 
Posts: 333
Joined: 2014-1-04 @ 09:17

Re: DOSBox Feature Request Thread

Postby Grunt » 2019-12-03 @ 18:50

jmarsh wrote:You couldn't just shove frames down a pipe,

Of course you could. See yuv4mpegpipe. Unfortunately every possible YUV pix_fmt but not a one RGB. And no rgb4mpegpipe either. I'll look into it.

jmarsh wrote:DOSBox only records audio that goes through its mixer, if you're using an external midi device the output won't be recorded.

Oh, so what I hear is output from Windows MIDI mapper and isn't recorded into AVI?
User avatar
Grunt
Newbie
 
Posts: 5
Joined: 2019-7-05 @ 17:19
Location: Europe

Re: DOSBox Feature Request Thread

Postby petran79 » 2019-12-07 @ 22:55

Is it possible to add support for refresh rates higher than 60 hz? DOS games played up to 70hz in some games. Also can DOSBOX take advantage of Gsync/Freesync like WinUAE does?
petran79
Newbie
 
Posts: 3
Joined: 2017-12-01 @ 17:52

Previous

Return to DOSBox General

Who is online

Users browsing this forum: BLEXBot [Bot], knowledge [bot] and 2 guests