kushalkolar / MESmerize

Platform for Calcium Imaging analysis. DEPRECATED.
GNU General Public License v3.0
59 stars 14 forks source link

Problem Exporting Video #57

Closed katherinekelly2012 closed 3 years ago

katherinekelly2012 commented 3 years ago

Describe the bug

When I attempt to export my video I get the pop up form, but when I press the second export I get the following error:

AssertionError: Unknown encoder extension

To Reproduce

  1. Go to viewer
  2. Click on image then load image
  3. Press on export button above histogram
  4. With the form, press export again
  5. Then the error occurs

Expected behavior I expected it to export

Copy paste message from the error window (if any)

This is the error from the 'Show Details':

Traceback (most recent call last): File "c:\users\katherine\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\common\qdialogs.py", line 52, in fn return func(self, *args, **kwargs) File "c:\users\katherine\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\viewer\modules\exporter.py", line 111, in export writer = skvideo.io.FFmpegWriter(f'{path}.{extn}', outputdict=output_params) File "c:\users\katherine\miniconda3\envs\mesmerize\lib\site-packages\skvideo\io\ffmpeg.py", line 336, in init assert str.encode(self.extension).lower() in _FFMPEG_SUPPORTED_ENCODERS, "Unknown encoder extension: " + self.extension.lower() AssertionError: Unknown encoder extension:

Copy-paste or take a screenshot of the terminal that Mesmerize is running in

![image](<img width="960" alt="terminalfromerror" src="https://user-images.githubusercontent.com/77304549/123695196-430aba00-d828-11eb-8577-a0fd82625234.png">

Make sure the entire stack trace is visible, and all messages relevant to the issue are visible.

If relevant, messages from the batch manager terminal

Screenshots

errorimage

Operating System & specs (CPU, RAM etc.). Please complete the following information:

kushalkolar commented 3 years ago

Hi, @katherinekelly2012

Thanks for providing details!

You haven't entered a path to export it, enter a path or click the ... button to choose a path for the exported file. I think that both .mp4 and .avi extensions will work for x264. I'm sorry that this module isn't documented, I'll try to add it to the docs this week.

Let me know if it works for you!

EricThomson commented 3 years ago

I was trying to reproduce this tonight (also in Windows 10). A couple of things:

  1. When I click the ... button no directory selection gui thing opens for me.
  2. I added a path manually and for libx264 format tried to save with name foo.mp4 and got the following error:

Traceback (most recent call last): File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\common\qdialogs.py", line 52, in fn return func(self, *args, **kwargs) File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\viewer\modules\exporter.py", line 111, in export writer = skvideo.io.FFmpegWriter(f'{path}.{extn}', outputdict=output_params) File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\skvideo\io\ffmpeg.py", line 336, in init assert str.encode(self.extension).lower() in _FFMPEG_SUPPORTED_ENCODERS, "Unknown encoder extension: " + self.extension.lower() AssertionError: Unknown encoder extension: .avi

I found that puzzling, changed it to foo.avi of course got the same error.

Changed format to wmv2, tries to save foo.avi, and keep getting the error.

Back in the powershell I get:

%(asctime)s %(levelname)s %(pathname)s %(lineno)s %(message)s Normalizing image for 8bit video output Normalizing image for 8bit video output %(asctime)s %(levelname)s %(pathname)s %(lineno)s %(message)s Creating ffmpeg writer Creating ffmpeg writer %(asctime)s %(levelname)s %(pathname)s %(lineno)s %(message)s AssertionError: Unknown encoder extension: .avi Traceback (most recent call last): File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\common\qdialogs.py", line 52, in fn return func(self, *args, **kwargs) File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\mesmerize\viewer\modules\exporter.py", line 111, in export writer = skvideo.io.FFmpegWriter(f'{path}.{extn}', outputdict=output_params) File "c:\users\lab_user\miniconda3\envs\mesmerize\lib\site-packages\skvideo\io\ffmpeg.py", line 336, in init assert str.encode(self.extension).lower() in _FFMPEG_SUPPORTED_ENCODERS, "Unknown encoder extension: " + self.extension.lower() AssertionError: Unknown encoder extension: .avi

kushalkolar commented 3 years ago

@EricThomson Do you have ffmpeg installed? Not sure how that works with conda on windows. Did you try without specifying an extension?

EricThomson commented 3 years ago

I get the same thing when I don't specify an extension.

In terms of ffmpeg, it is being used by opencv -- output of print(cv2.getBuildInformation()` in my mesmerize environment:

Video I/O: DC1394: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (58.91.100) avformat: YES (58.45.100) avutil: YES (56.51.100) swscale: YES (5.7.100) avresample: YES (4.0.0)

But I don't have it installed generally for use in my Windows path.

Edit: I just added ffmpeg to my Windows machine more generally so it's in my Windows Path, and I'm getting the same error.

kushalkolar commented 3 years ago

Closing due to inactivity.