home.social

#ffprobe — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #ffprobe, aggregated by home.social.

  1. can’t believe how long I’ve suffered through “Argument 'abc.mp4' provided as input filename, but 'xyz.mp4' was already specified” errors before writing this little function to support `ffprobe *.mp4`: github.com/lucaswerkmeister/ho

    #ffmpeg #ffprobe

  2. Keeping kDrive Tidy Despite iOS

    Reading Time: 3 minutes

    One of the many iOS flaws is that if you download photos and videos it defaults to throwing them into your photo album, whether they're yours, and that's why it's good to tidy up. For the tidying up effort today I used ffprobe, find and the kDrive desktop drive, as well as terminal and a secure shell.

    The premise is that as you're living your life, activity friends, family and apps like TikTok all post files, that you might or might not download intentionally. I'd recommend downloading them intentionally. We'll cover this shortly.

    RSYNC

    Due to having at least two phones over the years I had two folders with photos that needed to be consolidated. I used rsync to consolidate both folders and then deleted the 8plus folder that no longer had a reason to be.

    FFProbe

    I started the day with the premise that apple Photos took .mov videos and apps like Whatsapp, Signal and TikTok used mp4 files. I used find to clear up the mess of MP4 files, and got them sorted chronologically. I was pleasantly surprised to see that whatsapp and other files were sorted into their own folders.

    It's with disappointment that I noticed that TikTok saves part of the messy files as .mov files. If I used exiftool then I could setup a filter "if video files do not mention iphone, add them to sorted, and leave the others as they are". The issue is that exiftool is slow.

    I asked Euria for help and it suggested FFProbe so I experimented with it. I told it, find all non 1920,1080 videos and move them to sorted, so it wrote a shell script to do that. It worked well enough but I still double checked what it had moved. Eventually, when I got to videos that I shot in 4K I asked it to widen what it kept, so it re-wrote the shell script.

    For once I sorted each year, one at a time, from 2023-2026. It was fast, and effective. In some cases I rescued files from the sorted folder that I wanted to keep.

    My rational behind creating a "sorted" folder, per month, was so that I could then get a script to move the "sorted" video files chronologically into the "chaff" folder that I setup this morning.

    If I had done this with exiftool or manually it would have taken ages. By getting a simple tool to do this task it took seconds per year.

    Much Tidier

    The photos backup folder that syncs from my phone to kDrive, and from kDrive to my desktop started the day without about 400gb of files. After some quick tidying this morning, thanks to shell scripts and the command line I got it down to 90GB.

    The next step is to reconcile those 90GB of photos with the main photo library I have. Once the two are merged my kDrive phone photos backup folder could be nearly empty.

    And Finally

    One of the key advantages of using kDrive, rather than Google Photos, Apple Photos, Flickr and other cloud solutions is that you can tidy directly from the command line with a few practical prompts. Doing the same in a web browser takes hours. I know because I tried.

    Having a local copy of what's in the cloud allows you to clean up within minutes, for free. No need for expensive apps. You're in full control. Once you're done it propagates back to the server.

    TLDR

    I mention kDrive but Google Drive, iCloud, One Drive and most other solutions offer the same flexibility. If you store photos within folders and files, rather than photos app, data migration is simplified.

    #ffprobe #find #infomaniak #iOS #kdrive
  3. Keeping kDrive Tidy Despite iOS

    Reading Time: 3 minutes

    One of the many iOS flaws is that if you download photos and videos it defaults to throwing them into your photo album, whether they're yours, and that's why it's good to tidy up. For the tidying up effort today I used ffprobe, find and the kDrive desktop drive, as well as terminal and a secure shell.

    The premise is that as you're living your life, activity friends, family and apps like TikTok all post files, that you might or might not download intentionally. I'd recommend downloading them intentionally. We'll cover this shortly.

    RSYNC

    Due to having at least two phones over the years I had two folders with photos that needed to be consolidated. I used rsync to consolidate both folders and then deleted the 8plus folder that no longer had a reason to be.

    FFProbe

    I started the day with the premise that apple Photos took .mov videos and apps like Whatsapp, Signal and TikTok used mp4 files. I used find to clear up the mess of MP4 files, and got them sorted chronologically. I was pleasantly surprised to see that whatsapp and other files were sorted into their own folders.

    It's with disappointment that I noticed that TikTok saves part of the messy files as .mov files. If I used exiftool then I could setup a filter "if video files do not mention iphone, add them to sorted, and leave the others as they are". The issue is that exiftool is slow.

    I asked Euria for help and it suggested FFProbe so I experimented with it. I told it, find all non 1920,1080 videos and move them to sorted, so it wrote a shell script to do that. It worked well enough but I still double checked what it had moved. Eventually, when I got to videos that I shot in 4K I asked it to widen what it kept, so it re-wrote the shell script.

    For once I sorted each year, one at a time, from 2023-2026. It was fast, and effective. In some cases I rescued files from the sorted folder that I wanted to keep.

    My rational behind creating a "sorted" folder, per month, was so that I could then get a script to move the "sorted" video files chronologically into the "chaff" folder that I setup this morning.

    If I had done this with exiftool or manually it would have taken ages. By getting a simple tool to do this task it took seconds per year.

    Much Tidier

    The photos backup folder that syncs from my phone to kDrive, and from kDrive to my desktop started the day without about 400gb of files. After some quick tidying this morning, thanks to shell scripts and the command line I got it down to 90GB.

    The next step is to reconcile those 90GB of photos with the main photo library I have. Once the two are merged my kDrive phone photos backup folder could be nearly empty.

    And Finally

    One of the key advantages of using kDrive, rather than Google Photos, Apple Photos, Flickr and other cloud solutions is that you can tidy directly from the command line with a few practical prompts. Doing the same in a web browser takes hours. I know because I tried.

    Having a local copy of what's in the cloud allows you to clean up within minutes, for free. No need for expensive apps. You're in full control. Once you're done it propagates back to the server.

    TLDR

    I mention kDrive but Google Drive, iCloud, One Drive and most other solutions offer the same flexibility. If you store photos within folders and files, rather than photos app, data migration is simplified.

    #ffprobe #find #infomaniak #iOS #kdrive
  4. J'ai cassé mon instance #mastodon à cause d'une maj #debian et ce n'est pas la première fois. Une maj=un prog qui ne démarre plus. On va faire comme avec les médicaments, si #mastodon ne supporte pas son nouveau traitement #ruby donnez lui un générique. J'ai eu la même avec #PeerTube qui n'a pas aimé le #ffmpeg et #ffprobe remplacés par la maj #debian mais là c'était fourbe parce que je ne savais pas que mon instance refusait les uploads de vidéos jusqu'à que je teste et personne ne dit rien !🤬

  5. @sundogplanets

    For completeness:

    To find out the dimensions of a video, use #ffprobe, part of the #ffmpeg suite:

    $ ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 source-video.mp4

    To extract images from a movie, at 10 frames per second:

    $ ffmpeg -i source-video.mp4 -vf fps=10 slice-%d.png

    To cut a video from time 5 seconds to time 12 minutes and 20 seconds (12*60+20=740, minus 5 gives 735; -ss is the start, and -t the duration from that point onwards):

    $ ffmpeg -ss 5 -t 735 -i source-video.mp4 -vcodec libx265 -strict -2 lecture- cropped.mp4

    To scale a video down to half the area (50% of width and height), add this image filter to the arguments, where "iw" is the input video width, and "ih" the input video height:

    -vf "scale=iw/2:ih/2"

    To concatenate videos, create a text file with the file path to each of the videos, name it "cuts.txt", and then:

    $ ffmpeg -f concat -i cuts.txt -c copy video-edited.mp4

  6. Rather than do a quick patch/fix, for the 0 sample content file issue in did a complete correction, along with small refactor to make logic easier to follow, and code easier to read. Now -Z analyze mode collects and shows all 0 size errors, along with < minimum value, and -Xq exits with error for both and options.

    Also added size print for < 1 KiB, for B, that wasn't supported so showed 0 if < 1 KiB, now shows B, a 0 sample is 86 B, for example due to metadata.