• AI Can Write FFMPEG Scripts

    From Dr. Noah Bodie@noah@bodie.not to alt.os.linux.mint,alt.os.linux.ubuntu on Fri Mar 22 16:20:52 2024
    From Newsgroup: alt.os.linux.ubuntu

    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s
    and it did it in one take.

    This could make using FFMPEG easier for certain tasks.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Big Al@alan@invalid.com to alt.os.linux.mint,alt.os.linux.ubuntu on Fri Mar 22 15:41:08 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I asked it to write an app that
    would convert stereo mp3s into mono mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.
    what AI program did you use?
    --
    Linux Mint 21.3 Cinnamon 6.0.4 Kernel 6.5.0-26-generic
    Al

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Paul@nospam@needed.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Fri Mar 22 19:30:43 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/22/2024 3:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I asked it to write an app that would convert stereo mp3s into mono mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.
    what AI program did you use?

    CoPilot:

    $ Give a command line invocation of FFMPEG to convert a stereo MP3 into a monophonic MP3

    ffmpeg -i input.mp3 -c:a libmp3lame -q:a 2 -ac 1 output.mp3

    Explanation:

    -i input.mp3: Specifies the input stereo MP3 file.
    -c:a libmp3lame: Sets the audio codec to libmp3lame for the output.
    -q:a 2: Controls the audio quality (2 is a reasonable value).
    -ac 1: Converts the audio to mono (single channel).
    output.mp3: Specifies the output monophonic MP3 file.

    *******

    https://trac.ffmpeg.org/wiki/AudioChannelManipulation

    "Mix a single stereo stream down to a mono stream.
    Both channels of the stereo stream will be downmixed into the stream"

    Paul

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Dr. Noah Bodie@noah@bodie.not to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 08:39:55 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 03/22/2024 04:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s
    and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    what AI program did you use?

    https://chat.openai.com/

    me:
    "write an ffmpeg script that will convert every mp3 in the current
    folder to 96KB mono"

    ai:
    #!/bin/bash

    # Check if ffmpeg is installed
    if ! command -v ffmpeg &>/dev/null; then
    echo "Error: ffmpeg is not installed."
    exit 1
    fi

    # Iterate over each MP3 file in the current directory
    for file in *.mp3; do
    # Generate output file name
    output_file="${file%.mp3}_mono.mp3"

    # Run ffmpeg command to convert to 96kbps mono
    ffmpeg -i "$file" -ac 1 -b:a 96k "$output_file"

    # Output conversion result
    if [ $? -eq 0 ]; then
    echo "Conversion of $file successful."
    else
    echo "Error converting $file."
    fi
    done
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Big Al@alan@invalid.com to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 11:45:08 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/23/24 07:39 AM, Dr. Noah Bodie wrote:
    On 03/22/2024 04:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s
    and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    what AI program did you use?

    https://chat.openai.com/

    me:
    "write an ffmpeg script that will convert every mp3 in the current folder to 96KB mono"

    ai:
    #!/bin/bash

    # Check if ffmpeg is installed
    if ! command -v ffmpeg &>/dev/null; then
    echo "Error: ffmpeg is not installed."
    exit 1
    fi

    # Iterate over each MP3 file in the current directory
    for file in *.mp3; do
    # Generate output file name
    output_file="${file%.mp3}_mono.mp3"

    # Run ffmpeg command to convert to 96kbps mono
    ffmpeg -i "$file" -ac 1 -b:a 96k "$output_file"

    # Output conversion result
    if [ $? -eq 0 ]; then
    echo "Conversion of $file successful."
    else
    echo "Error converting $file."
    fi
    done

    Wow, that's interesting, error checking and all. I have to hand to AI.
    --
    Linux Mint 21.3 Cinnamon 6.0.4 Kernel 6.5.0-26-generic
    Al

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Paul@nospam@needed.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 12:29:41 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/23/2024 7:39 AM, Dr. Noah Bodie wrote:
    On 03/22/2024 04:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s
    and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    what AI program did you use?

    https://chat.openai.com/

    me:
    "write an ffmpeg script that will convert every mp3 in the current folder to 96KB mono"

    ai:
    #!/bin/bash

    # Check if ffmpeg is installed
    if ! command -v ffmpeg &>/dev/null; then
    echo "Error: ffmpeg is not installed."
    exit 1
    fi

    # Iterate over each MP3 file in the current directory
    for file in *.mp3; do
    # Generate output file name
    output_file="${file%.mp3}_mono.mp3"

    # Run ffmpeg command to convert to 96kbps mono
    ffmpeg -i "$file" -ac 1 -b:a 96k "$output_file"

    # Output conversion result
    if [ $? -eq 0 ]; then
    echo "Conversion of $file successful."
    else
    echo "Error converting $file."
    fi
    done

    How did the AI know that you wanted a bash script ?

    If this was a student assignment, we would expect
    better of them. There are some assumptions in the
    script. The script is still a bit lazy.

    The script has erroneously assumed that MP3 files
    always end in .mp3 , which may not be the case.
    The OS does not make mistakes like that. The OS
    uses the "file" command to ID items.

    And as has been so ably demonstrated by lawyers, you
    cannot just verbatim copy the output of an AI
    and run with it. It needs error checking and analysis.
    Just as in OCR, you would thoroughly review the
    workmanship, for the 1% expected error rate.

    Still, I'll give it five points for writing a "pretty"
    script. You can give some prompts, to change the
    "style" of the kind of script it writes. It did
    work step-by-step, so maybe the available prompt
    has already been given.

    The danger with giving too many constraints, is
    driving the AI off into the weeds.

    My very first question for an AI, I gave it an
    unbounded question :-) Purely an accident on my part.
    A lazy input, dood. I got a lot of babbling, then
    it erased the output and declared a "timeout"
    as it was taking too long to go to infinity and beyond.
    I'm sure the fans were spinning for a few seconds
    until it cooled off.

    It's like when we had this crusty database at work
    (distributed, on multiple mainframes), and when you
    logged into it, there was a warning in red to
    "Don't give it the following command and light up
    the entire database!". Failure to listen to the
    instructions about careless queries, was loss of
    your account. Back then they did not "suffer fools".

    Paul
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Brian Gregory@void-invalid-dead-dontuse@email.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 17:37:45 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 22/03/2024 23:30, Paul wrote:
    On 3/22/2024 3:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I asked it to write an app that would convert stereo mp3s into mono mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.
    what AI program did you use?

    CoPilot:

    $ Give a command line invocation of FFMPEG to convert a stereo MP3 into a monophonic MP3

    ffmpeg -i input.mp3 -c:a libmp3lame -q:a 2 -ac 1 output.mp3

    Explanation:

    -i input.mp3: Specifies the input stereo MP3 file.
    -c:a libmp3lame: Sets the audio codec to libmp3lame for the output.
    -q:a 2: Controls the audio quality (2 is a reasonable value).
    -ac 1: Converts the audio to mono (single channel).
    output.mp3: Specifies the output monophonic MP3 file.

    *******

    https://trac.ffmpeg.org/wiki/AudioChannelManipulation

    "Mix a single stereo stream down to a mono stream.
    Both channels of the stereo stream will be downmixed into the stream"

    Paul


    I've used both Bing chat and the Google one for similar things.
    At first I thought Bing chat was the better one but Google Gemini, as
    they now call it, is getting a lot better.
    --
    Brian Gregory (in England).

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Dr. Noah Bodie@noah@bodie.not to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 16:39:21 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 03/23/2024 12:45 PM, Big Al wrote:
    On 3/23/24 07:39 AM, Dr. Noah Bodie wrote:
    On 03/22/2024 04:41 PM, Big Al wrote:
    On 3/22/24 03:20 PM, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s >>>> and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    what AI program did you use?

    https://chat.openai.com/

    me:
    "write an ffmpeg script that will convert every mp3 in the current
    folder to 96KB mono"

    ai:
    #!/bin/bash

    # Check if ffmpeg is installed
    if ! command -v ffmpeg &>/dev/null; then
    echo "Error: ffmpeg is not installed."
    exit 1
    fi

    # Iterate over each MP3 file in the current directory
    for file in *.mp3; do
    # Generate output file name
    output_file="${file%.mp3}_mono.mp3"

    # Run ffmpeg command to convert to 96kbps mono
    ffmpeg -i "$file" -ac 1 -b:a 96k "$output_file"

    # Output conversion result
    if [ $? -eq 0 ]; then
    echo "Conversion of $file successful."
    else
    echo "Error converting $file."
    fi
    done

    Wow, that's interesting, error checking and all. I have to hand to AI.

    AI can also write simple PHP apps, like bulk mailing programs that send
    emails to a dozen people.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Fokke Nauta@usenet@solfon.nl to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 21:39:29 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono mp3s
    and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Nic@Nic@none.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sat Mar 23 16:44:02 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono
    mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Fokke Nauta@usenet@solfon.nl to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 09:14:46 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 23/03/2024 21:44, Nic wrote:
    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono
    mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.

    But the quality of the music is less.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Nic@Nic@none.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 07:12:47 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/24/24 4:14 AM, Fokke Nauta wrote:
    On 23/03/2024 21:44, Nic wrote:
    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono
    mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.

    But the quality of the music is less.
    Monophonic does not imply lower fidelity or quality. I recall many years
    ago that monophonic was the better quality and stereo which was new at
    the time was not the first choice of high fidelity enthusiasts.

    A little music to exercise those voice coils- https://www.youtube.com/watch?v=rMp7M3kx3E4


    Sibelius Karelia suite Op 11

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Paul@nospam@needed.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 08:49:22 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/24/2024 7:12 AM, Nic wrote:
    On 3/24/24 4:14 AM, Fokke Nauta wrote:
    On 23/03/2024 21:44, Nic wrote:
    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I asked it to write an app that would convert stereo mp3s into mono mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.

    But the quality of the music is less.
    Monophonic does not imply lower fidelity or quality. I recall many years ago that monophonic was the better quality and stereo which was new at the time was not the first choice of high fidelity enthusiasts.

    A little music to exercise those voice coils- https://www.youtube.com/watch?v=rMp7M3kx3E4


     Sibelius Karelia suite Op 11

    But part of this is psychology.

    Back when we had 78 RPM records, there would be clicks
    and hiss and a non-flat spectrum.

    You become so used to the artifacts, that the artifacts
    become "an objective", an expectation, of the listener.
    You're not listening to "an immersive recording of the
    Philharmonic", you're listening to "a 78RPM recording
    of the Philharmonic with original pops and hiss".

    "It doesn't sound right", when a new technology comes along.
    "It sound flat and lifeless". Yes, if you're used to a lot
    of high frequency artifact, and you listen to a cleaner system,
    it does not sound right.

    Multichannel systems are intended to be immersive. CD recordings
    would have had more than two tracks (stereo), if we could have
    fitted them in.

    At one time, long play albums were recorded in the studio on
    four track tape, and mixed down to stereo. There were no
    fancy HRTFs to do that, just like making soup "I will take
    40% from channel1 and 60% from channel2 and make L". The studio
    was not really all that much more sophisticated than the user.

    Even today, people have a fetish for certain sound qualities.
    We don't go for "the most realistic immersive experience",
    we like the even harmonics of vacuum tube distortions.

    I bet people who were inured to low bandwidth MP3s with
    compression artifacts, those people have the same kind of
    expectations as the 78RPM listeners waiting for the hiss
    and pops :-) If you gave them sample-accurate (uncompressed)
    sound, it would not sound right. But that's the psychology
    of it, at work.

    Too much "digital mutilation" of recorded content, and when
    you actually do go to the Philharmonic, it's nothing like
    the 22 channel Dolby ATMOS you were listing to at home :-)
    The live session doesn't sound right.

    At least one of the concert halls, was redesigned, and
    has improved acoustics (and fewer seats). Now at least, when
    you visit in person, it's getting closer to the
    22 channel Dolby ATMOS they made artificially in the mixer.

    Paul
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From John Williamson@johnwilliamson@btinternet.com to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 13:25:29 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 24/03/2024 11:12, Nic wrote:
    On 3/24/24 4:14 AM, Fokke Nauta wrote:
    On 23/03/2024 21:44, Nic wrote:
    But the quality of the music is less.
    Monophonic does not imply lower fidelity or quality. I recall many years
    ago that monophonic was the better quality and stereo which was new at
    the time was not the first choice of high fidelity enthusiasts.

    Whereas now, a lot of hifi enthusiasts claim that vinyl sounds better
    than CD. There are, however, differences in the mastering which can make
    vinyl sound more pleasant in a poorly treated room. I can equaliseda CD
    to sound as muffled as an LP either on playbackro when I am mastering it.

    As far as the difference between mono and stereo goes, what is being
    recorded, where and how it has been recorded, mixed and mastered matter
    a lot, and even the quality of the playback equipment makes a major difference.
    --
    Tciao for Now!

    John.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 14:59:55 2024
    From Newsgroup: alt.os.linux.ubuntu

    Fokke Nauta wrote:
    On 23/03/2024 21:44, Nic wrote:
    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I
    asked it to write an app that would convert stereo mp3s into mono
    mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.

    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.

    But the quality of the music is less.

    Not important for audiobooks or podcasts. No need for stereo effects
    when listening to vocal recordings.

    Also the two channels are simply mixed, there is no real loss of quality.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Nic@Nic@none.invalid to alt.os.linux.mint,alt.os.linux.ubuntu on Sun Mar 24 16:29:17 2024
    From Newsgroup: alt.os.linux.ubuntu

    On 3/24/24 8:49 AM, Paul wrote:
    On 3/24/2024 7:12 AM, Nic wrote:
    On 3/24/24 4:14 AM, Fokke Nauta wrote:
    On 23/03/2024 21:44, Nic wrote:
    On 3/23/24 4:39 PM, Fokke Nauta wrote:
    On 22/03/2024 20:20, Dr. Noah Bodie wrote:
    I just found out that AI can write short scripts that use FFMPEG. I asked it to write an app that would convert stereo mp3s into mono mp3s and it did it in one take.

    This could make using FFMPEG easier for certain tasks.
    Why would you convert a stereo mp3 into a mono mp3?

    Fokke
    The resultant file is smaller.
    But the quality of the music is less.
    Monophonic does not imply lower fidelity or quality. I recall many years ago that monophonic was the better quality and stereo which was new at the time was not the first choice of high fidelity enthusiasts.

    A little music to exercise those voice coils-
    https://www.youtube.com/watch?v=rMp7M3kx3E4


     Sibelius Karelia suite Op 11
    But part of this is psychology.

    Back when we had 78 RPM records, there would be clicks
    and hiss and a non-flat spectrum.

    You become so used to the artifacts, that the artifacts
    become "an objective", an expectation, of the listener.
    You're not listening to "an immersive recording of the
    Philharmonic", you're listening to "a 78RPM recording
    of the Philharmonic with original pops and hiss".

    "It doesn't sound right", when a new technology comes along.
    "It sound flat and lifeless". Yes, if you're used to a lot
    of high frequency artifact, and you listen to a cleaner system,
    it does not sound right.

    Multichannel systems are intended to be immersive. CD recordings
    would have had more than two tracks (stereo), if we could have
    fitted them in.

    At one time, long play albums were recorded in the studio on
    four track tape, and mixed down to stereo. There were no
    fancy HRTFs to do that, just like making soup "I will take
    40% from channel1 and 60% from channel2 and make L". The studio
    was not really all that much more sophisticated than the user.

    Even today, people have a fetish for certain sound qualities.
    We don't go for "the most realistic immersive experience",
    we like the even harmonics of vacuum tube distortions.

    I bet people who were inured to low bandwidth MP3s with
    compression artifacts, those people have the same kind of
    expectations as the 78RPM listeners waiting for the hiss
    and pops :-) If you gave them sample-accurate (uncompressed)
    sound, it would not sound right. But that's the psychology
    of it, at work.

    Too much "digital mutilation" of recorded content, and when
    you actually do go to the Philharmonic, it's nothing like
    the 22 channel Dolby ATMOS you were listing to at home :-)
    The live session doesn't sound right.

    At least one of the concert halls, was redesigned, and
    has improved acoustics (and fewer seats). Now at least, when
    you visit in person, it's getting closer to the
    22 channel Dolby ATMOS they made artificially in the mixer.

    Paul
    Yet not much has been done with microphone technology, it is still some
    sound amplification of our mutters and grunts converted to electrical
    impulses recorded on some magnetic mediam. Is it psychological to assume
    that the possible existence of a soul would seriously damage the matrix continuum I hope there is an OS that can sort all this.

    Voice Coil Exercise  https://www.youtube.com/watch?v=4FlOVs-G13U


    Entrance Of The Gods Into Valhalla



    --- Synchronet 3.20a-Linux NewsLink 1.114