mooch443 / trex

TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields.
https://trex.run
GNU General Public License v3.0
81 stars 8 forks source link

Trex Quitting Unexpectedly + TGrabs not showing up on Trex #149

Closed chaerimkang01 closed 2 years ago

chaerimkang01 commented 2 years ago

Describe the bug Hello, Trex has been so helpful in my research so far but I have been running into two problems recently

  1. When converting RAW to PV and I click "open", TGrabs is able to track the tadpoles but crashes midway. This happens regardless of the length/ quality of the video. Terminal output and problem details/ system configuration is attached below.

  2. As mentioned previously, TGrabs is able to track the tadpoles but when I open the PV version, the tracked version no longer shows up.

Screen Shot 2022-03-26 at 6 38 06 PM Screen Shot 2022-03-26 at 6 36 22 PM

To Reproduce Steps to reproduce the behavior:

  1. Start program with command-line conda activate tracking -> trex
  2. Click on "Convert (RAW)" -> video name -> "open" on the bottom
  3. TGrabs will start tracking and then quit
  4. Once I open the PV file (that is only converted half way since it quits), Trex no longer tracks the tadpoles

Problem Details and System Configuration.pdf [Terminal Saved Output.pdf](https://github.com/mooch443/trex/files/8356492/Terminal.Saved.Output.pdf)

Computer

mooch443 commented 2 years ago

Hey,

so from the Log (and screenshot) I can see that there is a problem with the video apparently. It cannot read frame 981, despite the video apparently reporting 983 frames - this could easily be fixed by running

ffmpeg -i video.mp4 -c copy video_fixed.mp4

which remuxes the video to the appropriate length (with barely any time spent, since it is not re-encoding it). Can you let me know if this works?

Despite this, the tadpoles should be tracked in TRex (given correct settings). TGrabs only tracks individuals if you pass it the -enable_live_tracking parameter on the command-line, too. Not sure whether you've adjusted any settings in TRex yet (probably have), but take a look in TRex at what is displayed when you press D there (see here: keyboard shortcuts). It should switch to the RAW view and display numbers. The numbers next to the tadpoles should be cyan if they are in range of your blob_size_ranges settings (see also here: parameter order).

Just a few pointers at the risk of telling you something you already know! Hope it helps :-)

chaerimkang01 commented 2 years ago

Hi thank you so much for the detailed response! Yes, copying the video did work. Is it a problem on my end regarding video format? While this is a quick fix, it is a bit inconvenient to have to make a copy when I'm analyzing many videos and it would be great if I could solve the root of the problem too!

Appreciate your work :)

mooch443 commented 2 years ago

Hey,

so this is not just doing a "copy". It actually "remuxes" the video, so that the length/timings and so on are correct in the video file itself. It should be quite safe to remove the old file after remuxing it (since codec=copy), but you should make sure that nothing else is missing before you do it (e.g. additional audio/video channels).

However, to me it seems that the video is being converted and the .PV should exist in your system already despite the "crash". Actually, the crash is only a crash of the opening process (the process that opens TGrabs) and not TGrabs itself, as far as I can tell. Of course it isn't pretty to have this happening, and I am "working on it".

-Tristan