anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.87k stars 182 forks source link

snap install -> Could not open file #73

Closed Humphreybas closed 3 years ago

Humphreybas commented 3 years ago

On ubuntu 18.04, I installed with: sudo snap install --edge untrunc-anthwlock

But when I run it I get:

$ untrunc-anthwlock -s good.mp4 bad.mp4
Info: version 'd6f0790' using ffmpeg '3.3.9'
Info: reading 20160827_223027.mp4
Could not open file: good.mp4

But the file is there.

anthwlock commented 3 years ago

It's a "feature" of snap, see the docs. It results in files outside of $HOME not being accessable. Here an discussion.

In case your files are on a /media device, I believe you can use sudo snap connect untrunc-anthwlock:removable-media. This allows untrunc-anthwlock access to the removable-media interface. Maybe this can be requested automatically. VLC seems to do so.

Humphreybas commented 3 years ago

Ah ok, hmmm. Interesting discussion that you point to as well, nice and heated hehe. In my laptop I have a SSD (with the operating system and my home folder) and a larger HDD (with many of my files), I mounted the latter under /hdd so this confinement is also not really helping me in this particular case.

So I will just continue to use the docker. I am using it with the --rm flag by the way. To avoid leaving a container every time I run it. docker run --rm -v ~/Videos/:/mnt untrunc /mnt/ok.mp4 /mnt/broken.mp4

Thanks!

madatr commented 2 years ago

Same here but on a mac, I tried moving everything to home folder and whatnot but it is still showing me this. I installed the package using docker: docker pull synctree/untrunc Please help, Thanks.

Screenshot 2021-12-07 at 02 54 51
anthwlock commented 2 years ago

@madatr You are using docker, not snap. With docker you have to explicitly pass the directory which contains your files to the container. This can be done by specifying (so called) "volumes" like this: docker run -v /path/to/files:/files. Now the untrunc executable (in the docker container) can see your files under /files.

Complete example from the readme: docker run -v ~/Videos/:/mnt untrunc /mnt/ok.mp4 /mnt/broken.mp4 .

Related issue: https://github.com/ponchio/untrunc/issues/177