Closed gototheskinny closed 2 years ago
Looks like the Termux maintainers split apart the boost
package into the main package and the boost-headers
package. Install the boost-headers
package, then you should be able to do the python3 -m pip install -r /sdcard/requirements.txt
.
I'll update the README.md
accordingly.
I can confirm that issue is solved thank you for solving the issue.
~ $ python3 /sdcard/MotionPhotoMuxer.py
Traceback (most recent call last):
File "/sdcard/MotionPhotoMuxer.py", line 158, in <module>
main(parser.parse_args())
File "/sdcard/MotionPhotoMuxer.py", line 145, in main
convert(photo_path, video_path)
File "/sdcard/MotionPhotoMuxer.py", line 80, in convert
validate_inputs(photo_path, video_path)
File "/sdcard/MotionPhotoMuxer.py", line 18, in validate_inputs
if not exists(photo_path):
File "/data/data/com.termux/files/usr/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
When i try to run this script I get this. Im not an expert at all so how can i run this script?
I should probably improve the error handling so that the error messages are more clear, but you need to provide either a video/photo pair, or a directory as an argument to the script. So basically, you need to run it in one of the following ways:
python3 /sdcard/MotionPhotoMuxer.py --photo <path to jpg file> --video <path to video file>
or
python3 /sdcard/MotionPhotoMuxer.py --dir <path to folder containing jpgs and mov/mp4 files>
If you use the second method, then it will only process files where the names are the same (only the extensions differ). For example, it will merge IMG_0001.jpg
and IMG_0001.mov
together, but if you have IMG_0001.jpg
and IMG_0002.mov
it will skip over those.
Thank you so much literally there is nothing out there for this specific situation. I wish there is a gui for this script bc I dont know anything about coding.
Yeah, unfortunately I haven't had much time to work on this, but that would be a good idea. Maybe I'll look into it when my current semester is over.
~ $ python3 /sdcard/MotionPhotoMuxer.py --dir /sdcard/other/ --verbose
INFO:root:Enabled verbose logging
INFO:root:Processing dir: /sdcard/other/
INFO:root:Looking for videos named: /sdcard/other/IMG_0964
INFO:root:Looking for videos named: /sdcard/other/IMG_0964
INFO:root:Found 1 pairs.
INFO:root:subset of found image/video pairs: [('/sdcard/other/IMG_0964.JPG', '/sdcard/other/IMG_0964.mov')]
INFO:root:Merging /sdcard/other/IMG_0964.JPG and /sdcard/other/IMG_0964.mov.
INFO:root:Merged photo and video.
INFO:root:Reading existing metadata from file.
INFO:root:Found XMP keys: ['Xmp.xmp.CreateDate', 'Xmp.xmp.CreatorTool', 'Xmp.xmp.ModifyDate', 'Xmp.mwg-rs.Regions', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Extensions', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Extensions/apple-fi:AngleInfoYaw', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Extensions/apple-fi:AngleInfoRoll', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Extensions/apple-fi:ConfidenceLevel', 'Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Extensions/apple-fi:FaceID', 'Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions', 'Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:h', 'Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:w', 'Xmp.mwg-rs.Regions/mwg-rs:AppliedToDimensions/stDim:unit', 'Xmp.photoshop.DateCreated']
WARNING:root:Found existing XMP keys. They *may* be affected after this process.
Im sorry if I missed something but in the log it says Merged but merged file is not there. Ive tried this several times. Edit: i've tried the other method you've said .. same result
Hmm, that's weird. Are you looking at the output/
folder for the merged file? It will create the output folder in the directory that you're running the script from (which in your case seems to be the home directory). Does ls ~/output
work?
~ $ ls ~/output IMG_0673.JPG IMG_0964.JPG
It says this. But there is no new file. I suppose there should be a new folder ? Where should i look at?
Nope, that's it. Those are the new files that have the video merged with the photo. If you copy those to a phone with Google Photos installed, the photo should work and it should show the "play" button in the top right which should show the video associated with the photo.
Edit: Ah, I think the issue is that you're probably not able to see it from the file browser on your phone, right? That's because the home directory ~/
is under /data/data/com.termux/files/home
. You'll want to copy it to the /sdcard/
directory. Run the following in Termux:
$ cp ~/output/*.JPG /sdcard/
And that should copy it to the base of your phone's internal storage. Similarly, you can change it to any other location within /sdcard/
as needed, such as /sdcard/DCIM/Camera
.
Oh that was the issue!!! Thank you so much, it works!! I suggest you to inform future users of this script. First of all termux needs storage permission and you need to do manually secondly you need to do the "pkg upgrade" bc ssl part of the termux needs that. People like me needs the full on tutorial to be honest.
@gototheskinny Latest commit adds a --output
parameter which takes in the path to a folder where the output photos should be written to, making any folders that don't exist (assuming it has permissions to do so). Termux's own setup process is out of the scope for this project so I'm not planning to document that beyond what's already in the README.md
.
My device is : Samsung Galaxy Note Fan edition A7.0
Ive tried several times its not working.