-1

I record calls on my phone (as audio only). Records are storing to 3gp file. When I play a single file it can be mentioned that it is plaing few times faster then normal speed of conversation. I tested, that played on ffplay using command

ffplay.exe %1 -ar 8000

sounds as a real speed.

I would like to convert 3gp file to mp3 file using ffmpeg file (easy batch script running on Windows). I started with command line

ffmpeg.exe -i %1 -ar 8000 -f mp3 %1.mp3

but bitaire of mp3 don't sounds well (too fast). I performed experiments with -b, -b:a and others parameters but bitrate does not change.

Which parameters have I use to change 3gp to mp3 file with proper bitrate value?

Skamielina
  • 752
  • 6
  • 22

3 Answers3

0
-ar 8000

forces ffmpeg to interpret your input file as being sampled at 8kHz. Is tis the case or are you trying to downsample it to 8 kHz?

If so try the following instead:

-af "aresample=8000"

Please mark this as good answer if you're happy with it ;)

AJ29
  • 1,381
  • 10
  • 10
0

Well the commands you have fired are correct. I myself tried them myself and are working correctly. So firstly just try again with 1 file rather than batch files.

Here is command 1

ffmpeg -i input.3gp -ar 32k -f mp3 out.mp3 

Result

Bitrate of out.mp3 is 47kbps

Command 2

ffmpeg -i inout.3gp -b:a 32k out.mp3

Bitrate of out.mp3 32kbps

So you can go with any of the above. Cheers :)

BlueSword
  • 1,290
  • 12
  • 25
0

Below you will find a script that I altered to include .3gp files. It also does .mp4 .mkv and .webm files. The clarity of the voice was good at 30k and that is what is here, but if you want larger files with better sound clarity then try 200k. Call your script file vidconvmp3.sh for example and save it. Then Modch +x vidconvmp3.sh to authorize execute. then ./vidconvmp3.sh and your batch will run through and toss your mp3 files into a folder called Desktop-mp3 if you run terminal on the desktop... tah dah.

#!/usr/bin/env bash

# My bash Script to convert mp4 to mp3
# By NerdJK23
# web: www.computingforgeeks.com
# email: kiplangatmtai@gmail.com

# Requires
# ffmpeg installed
# lame installed
# Check https://computingforgeeks.com/how-to-convert-mp4-to-mp3-on-linux/

echo -ne """
1: Current directory
2: Provide directory
"""
echo ""
echo -n "Selection : "
read selection

case $selection in
    1)
    echo "Okay.."
    echo ""
    echo "Current dir is `pwd` "
    ;;
    2)
    echo ""
    echo -n "Give diretory name: "
    read dir_name

# Check if given directory is valid
if [ -d $dir_name ]; then

    cd "${$dir_name}"
    echo "Current directory is `pwd` "
    echo 
else
    echo "Invalid directory, exiting.."
    echo ""
    exit 10
fi

    echo
    ;;

   *)
       echo
       echo "Wrong selection"
       exit 11
       ;;
esac

echo ""

# Create dir to store mp3 files if it doesn't exist
# First get the current directory name

current_dir=`pwd`
base_name=` basename "$current_dir"`

if [[ ! -d "$base_name"-mp3 ]]; then

echo "$base_name" | xargs  -d "\n" -I {} mkdir {}-mp3
    echo ""
fi
echo ""


# Bigin to covert videos to mp3 audio files
# -d "\n" > Change delimiter from any whitespace to end of line character 

find . -name "*.mp4" -o -name "*.mkv" -o -name "*.webm" -o -name "*.3gp" | xargs  -d "\n"  -I {} ffmpeg -i {} -b:a 30K -vn "$base_name"-mp3/{}.mp3 

# remove video extensions

cd "${base_name}"-mp3

for file_name in *; do      
    mv "$file_name" "`echo $file_name | sed  "s/.mp4//g;s/.mkv//g;s/.3pg//g;s/.webm//g"`";
done

# Move audio directory to ~/Music

if [[ ! -d ~/Music ]]; then
    mkdir ~/Music
fi
cd ..

mv  "$base_name"-mp3 ~/Music/

# Check if conversion successfull

echo ""

if [[ $? -eq "0" ]];then
    echo " All files converted successfully"
else
    echo "Conversation failed"
    exit 1
fi