I'm messing around with sonification, a process where an image is imported into an audio editor as raw data, edited, then turned back into an image to create glitchy visual effects.
I started with a .tiff file. I import it into Audacity, then export it as .raw. Now I want to convert all those .raw files to .png for further work.
I have FFmpeg installed, open command on the folder where the images are located. I tried this code:
mkdir converted for f in (*.raw); do ffmpeg -i "$f" "converted/${f%.raw}.png"; done
I got back an error, on line 1, character 37:
Instruction body missing in the loop*.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingLoopStatement
What did I do wrong?
*Translated from Portuguese, on my end it says "Corpo de instrução ausente no loop do".
EDIT I was asked to run a couple commands and post their outputs. I assumed I should add ffmpeg in front of them.
The first one
file YOURFILE.raw
Returns the following (translated from Portuguese to English):
ffmpeg version 2026-07-09-git-8de8405796-full_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers
built with gcc 16.1.0 (Rev2, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-cairo --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-liboapv --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libsvtjpegxs --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-openal --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint --enable-whisper
libavutil 61. 2.100 / 61. 2.100
libavcodec 63. 5.100 / 63. 5.100
libavformat 63. 3.100 / 63. 3.100
libavdevice 63. 2.100 / 63. 2.100
libavfilter 12. 2.100 / 12. 2.100
libswscale 10. 2.100 / 10. 2.100
libswresample 7. 2.100 / 7. 2.100
[AVFormatContext @ 000001e9b3fbed80] Unable to choose an output format for 'file'; use a standard extension for the filename or specify the format manually.
[out#0 @ 000001e9b3fdaac0] Error initializing the muxer for file: Invalid argument
Error opening output file file.
Error opening output files: Invalid argument
The second one
od -xc YOURFILE.raw | head -3
Returns (again, translated):
head : The term 'head' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:26
+ ffmpeg od -xc 01+0.001 | head -3
+ ~~~~
+ CategoryInfo : ObjectNotFound: (head:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException