H264 compression error when converted .avi file is moved to imageJ


I'm having problems opening the converted .avi files on imageJ (fiji) and get getting the following error.

I've installed and updated the libraries mentioned but still getting the same problem.

Any help would be much appreciated,



  • Hi Matt,

    Welcome to the Forums!
    I took a look at this problem, and I think I spotted the problem and found a solution for it.
    The problem is related to the conversion tool we are using "under the hood" in the GUI. It should be an easy fix, and we hope to role out an update in a few days.

    In the meantime, if you are comfortable with the command line, you can use the following command to convert your videos (this can be used in windows/linux or mac).

    You'll need to install the "ffmpeg" (https://github.com/adaptlearning/adapt_authoring/wiki/installing-ffmpeg) and navigate to the folder where your files are.

    ' ffmpeg -i yourfile.h264 -pix_fmt nv12 -f avi -vcodec rawvideo convertedFile.avi '

    Let us know how it goes and also if we can help with anything else!

  • edited July 2018

    still struggling with the avi side. I did make a slight detour around the issue by adding a convert to mp4 feature that can be added into imageJ with the FFMPEG plugin. I'll share the code when the issue below is fixed and I can get on with the pi.

    On a separate note I'm having issues on all my browsers and both on my mac and on the pi set up getting on these forums, I'm only able to get on with firefox by making a security exception the others are saying no http not secure

  • Hi Matt,
    Thanks for the heads up! The problem should be fixed now.

  • Excellent, yep fixed!

  • edited July 2018

    So this is the code I pieced together on camera.py to make a functional mp4 converter, the button should appear just below the "to AVI" on the GUI, you can add the code in below the def camConv(self) section. Do you have an updated working version of camConV(self): I can try out?

    ` def camConv2(self):
    opts = dict()
    opts["filetypes"] = [('h264 files','.h264'),('all files','.*')]
    opts["initialdir"] = [self.basePath]

        fileName = askopenfilename(**opts)
        if fileName == '':
            print ('no files selected')
        outname = os.path.splitext(fileName)[0]+".mp4"
        files = os.listdir(fileName[0:lastInd])
        outCore = outname.rindex("/")
        print ("out:" + outname[outCore:])
        if outname[outCore+1:] in files:
            print ("file is already converted! Skipping...")
        command = ['MP4Box', '-add', fileName, outname]
  • Hi Matt,

    I finally got the chance to look at your code, and it works very nicely! We would like to incorporate it into the base code. Would you like to make the change yourself using github? (this way the proper credit in the github world goes to you)

Sign In or Register to comment.