[WIP] JPGVthon - Reworked JPGV encoder.

Discussion in '3DS - Homebrew Development and Emulators' started by Insidious611, Jan 9, 2016.

  1. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    This is the main thread for Project JPGVthon, my reworked encoder for Rinnegatamante's "JPGV" video format, part of the lpp-3ds project and as featured in ORGANIZ3D and Sunshell.

    Version Beta 1.1 has been officially released: http://www.somebodyelsesproblem.org/jpgvthon.rar
    If the above link is currently down, please try http://ash.somebodyelsesproblem.org/jpgvthon.rar

    Scroll to the bottom for the TL;DR version. :P

    I was unhappy with the lack of feedback when the encoder crashes, as well as what I felt were some lacking features and some design missteps in the current "vid2jpgv". This is not a criticism of Rinnegatamante's work, as he admits himself that it was made quickly and unsafely.

    One of the most notable new features of JPGVthon is that it can scale your videos for the 3DS screen without distorting the aspect ratio. It does this using a special scaling-and-padding filter algorithm for ffmpeg.*

    JPGVthon does not use any BAT files or anything, it's mostly self-contained, though it still calls ffmpeg.exe (which will still be packaged with it) to do the video dirty work. JPGVthon can be run in an interactive mode that will feel familiar to anyone who's run the vid2jpgv batch file, or it can be fed all the necessary parameters on a single command line and run non-interactively. I intend to use the latter functionality as the backend for a GUI version some time later.

    Currently, JPGVthon appears to be creating working JPGV files with OGG Vorbis audio, but files with PCM16 audio seem to be slightly broken as of yet, so until I've figured that one out (or given up, I mean, Vorbis should be good enough honestly), it won't be ready to be released to the public.

    The name is because it's a JPGV encoder written in Python. No worries for people who can't figure out how to install a Python interpreter, the final product will be an EXE file you can run just like any other.

    I honestly feel like JPGV is a tad underappreciated. As a 2DS owner, being able to play real time video, even if it is at low qualities and large file sizes, is pretty neat. So I'm hoping having an easier way to convert your video to JPGV might make people more interested in it.

    *I can't take credit for the ffmpeg scale-and-pad algorithm, I took it from http://superuser.com/questions/5472...ffmpeg-avconv-to-fit-into-static-sized-player and reworked it.

    TL;DR Version: I created a better JPGV converter so you can more easily watch videos on your 3DS. It will be coming out once I've fixed some shit.
     
    Last edited by Insidious611, Jan 11, 2016
    harii98, SLiV3R, Sinon and 4 others like this.


  2. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    Just so we've got a baseline for where I'm at ATM, here's a quote of the last post re: the current status that I made in the ORGANIZ3D thread:

     
    I pwned U! likes this.
  3. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    Okay so I figured out what was making the file 4 bytes larger, I missed a bit when reading through the code of the original where after figuring out the WAV data chunk 4 bytes is added to the start address before pulling the chunk into the buffer. I don't expect this will *fix* the PCM16 code as even PCM16-based files created by the current encoder from Rinnegatamante exhibit the same issue for me, but if I can at least be producing identical files then I can be sure it's not an issue on my end.

    EDIT: WOOT! The old jpgv_encode and my new program are now producing identical files for both PCM16 and OGG given the exact same inputs. Any remaining issues should be down to implementation or format problems, neither of which I can really help with atm (not yet set up for debugging on a 3DS). Expect a release Soon(TM).
     
    Last edited by Insidious611, Jan 10, 2016
    I pwned U! likes this.
  4. A_Random_Guy

    A_Random_Guy Officially That Dev

    Member
    862
    459
    May 22, 2015
    Malaysia
    Smea's closet
    So this means that i can make jpgv videos better or..?
     
  5. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    It means you can make them more easily, and you can make them with the right aspect ratio while still using all 400x240 of the 3DS's screen. Quality should be pretty much the same.

    And we've just had our first release! See the link at the top of the thread. Mods, can we change the title to [RELEASE] instead of [WIP]? No idea how to (if I even can) do it myself.
     
    I pwned U! and Rinnegatamante like this.
  6. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    Silly bug in the first release. Updated. If you downloaded it in the like, less than 10 minutes between release and now, redownload.
     
    I pwned U! likes this.
  7. MichaelJohnMoye

    MichaelJohnMoye Member

    Newcomer
    49
    8
    Jun 21, 2012
    United States
    On Your Hard Drive
    Where exactly does the program output the file to?, assuming it's actually converting the video for me
     
  8. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    Err, it outputs the file to... where you told it to output the file to?

    One of the questions is "output file name"...

    Assuming you didn't give a path, it'll be the current directory.

    Temporary working files are output to a "temp" subdirectory under the main directory, which is what you'll get before it muxes the final product.
     
    Last edited by Insidious611, Jan 13, 2016
  9. Quantumcat

    Quantumcat Dead and alive

    Member
    9,803
    5,120
    Nov 23, 2014
    Australia
    Canberra, Australia
    Is it limited to ten minute clips like the AVI 3D video converter?
     
  10. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    No, I've successfully converted an entire anime episode (using the low quality settings, it took up about 250 MB). After a while it had some audio sync issues, but that's down to the player afaict, which I'm not responsible for.
     
  11. MichaelJohnMoye

    MichaelJohnMoye Member

    Newcomer
    49
    8
    Jun 21, 2012
    United States
    On Your Hard Drive
    it was a frame rate issue, it wouldn't work with the video files original frame rate but lowering it caused issues with playback
     
    Last edited by MichaelJohnMoye, Jan 14, 2016
  12. raystriker

    raystriker Alpha PC Builder

    Member
    1,262
    409
    Dec 28, 2011
    India
    Bloomington
    What about subtitle support?
    nvm: this still feels in its infancy, I can wait.
     
    Last edited by raystriker, Jan 23, 2016
  13. raystriker

    raystriker Alpha PC Builder

    Member
    1,262
    409
    Dec 28, 2011
    India
    Bloomington
    Just tried this out. A 60mb 720p h.264 anime file gets converted to a 650mb jpgv file....As there any way to encode the files to a smaller file size?
     
  14. Apache Thunder

    Apache Thunder I have cameras in your head!

    Member
    4,088
    3,987
    Oct 7, 2007
    United States
    Levelland, Texas
    It's JPGV...Most likely not going to compete with h.264 in terms of file sizes. :P
     
  15. harii98

    harii98 Advanced Member

    Newcomer
    51
    11
    Jan 27, 2016
    United States
    :P
     
  16. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    First of all, properly encode in 3ds screen resolution.
    Use 24.000 HZ as samplerate with Vorbis as audiocodec.
    Also don't use 30 FPS (animes are 23 fps so it's useless you encode it as 30 fps) to save more space.
     
  17. Insidious611
    OP

    Insidious611 GBAtemp Regular

    Member
    140
    105
    Oct 23, 2010
    United States
    Plus it won't play very well at high framerates (and by high I mean >25FPS) either. I've noticed audio desync/looping as well as the expected chugging when playing higher framerates.
     
  18. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    It depends on how you reproduce it. On an N3DS with 804 MHZ Mode it should run very smooth also with 30 FPS ( http://rinnegatamante.it/O3DSvsN3DS.mp4 this is encoded in 30 FPS for example).
     
  19. Ripper00420

    Ripper00420 GBAtemp Advanced Fan

    Member
    740
    224
    Nov 5, 2013
    United States
    0xc000007b application was unable to start correctly. It did say missing msvcr100.dll, then I replaced and downloaded new then got the application error.
     
    A_Random_Guy likes this.
  20. A_Random_Guy

    A_Random_Guy Officially That Dev

    Member
    862
    459
    May 22, 2015
    Malaysia
    Smea's closet
    Worked for me.