<p>If the codecs of your input file are already h264 and aac for video and audio, respectively, you can just copy without decoding and encoding again.</p>
<pre><code>ffmpeg -i input.3gp -c:v copy -c:a copy output.mp4
</code></pre>
<p>The options <code>-c:v copy</code> and <code>-c:a copy</code> indicate video and audio won't be encoded again, respectively. If audio format in the input cannot be embedded to the output, you need to omit <code>-c:a copy</code> from above command.</p>
<p>If you need to encode again, an option <code>-qscale 0</code> will result similar quality (but not lossless).
below is an example.
You might combine with <code>-c:v copy</code> or <code>-c:a copy</code> if you don't need to encode video or audio again.</p>
<pre><code>ffmpeg -i input.3gp -qscale 0 output.mp4
</code></pre>

CC BY-SA 4.0
2021-05-09T20:11:34.843Z
Please check my edited question to see what I get if I try to copy video and audio.
D. Joe
CC BY-SA 4.0
2021-05-10T14:00:54.397Z
According to your error message, the audio need to be encoded again. Fortunately, video does not need to be encoded.
This command should work `ffmpeg -i input.3gp -c:v copy output.mp4`, which will encode audio but won't encode video.
kamae
CC BY-SA 4.0
2021-05-05T13:23:56.003Z
2021-05-28T13:57:05.487Z
2021-05-28T13:57:05.487Z
kamae
<p>I'm trying to get lossless conversion of 3gp to mp4 using ffmpeg.</p>
<p>I tried</p>
<pre><code>ffmpeg -i input.3gp -vcodec h264 -c:a aac output.mp4
</code></pre>
<p>I tried with &quot;libx264&quot; for the video codec, I tried just a simple</p>
<pre><code>ffmpeg -i input.3gp output.mp4
</code></pre>
<p>No matter what I try, for a 10 MB 3gp video I am getting a 5 MB mp4 video that doesn't seem to have the same quality.</p>
<p>Any suggestions are welcome.</p>
<p>Thank you.</p>
<p><strong>EDIT</strong></p>
<p>Here's what I get if I try to copy the Video and Audio codecs:</p>
<pre><code>ffmpeg -i  VIDEO0004.3gp  -c:v copy -c:a copy VIDEO0004.mp4
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0004.3gp':
  Metadata:
    major_brand     : 3gp4
    minor_version   : 768
    compatible_brands: 3gp4mp413gp6
    creation_time   : 2011-02-06T16:39:49.000000Z
    copyright       : 
    copyright-eng   : 
    rating          : 0
    location-eng    : +00.0000+000.0000/??
    location        : +00.0000+000.0000/??
  Duration: 00:01:00.20, start: 0.000000, bitrate: 1369 kb/s
  Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1355 kb/s, 9.90 fps, 9.92 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2011-02-06T16:39:49.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)
    Metadata:
      creation_time   : 2011-02-06T16:39:49.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[mp4 @ 0x7fbaf5009600] Could not find tag for codec amr_nb in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 -- 
</code></pre>

<ffmpeg><mp4><conversion><lossless>
Lossless convert 3gp video to mp4 using ffmpeg
D. Joe
# Lossless convert 3gp video to mp4 using ffmpeg

(Asked by: username_0 on 2021-05-04)

I'm trying to get lossless conversion of 3gp to mp4 using ffmpeg.
I tried
ffmpeg -i input.3gp -vcodec h264 -c:a aac output.mp4

I tried with "libx264" for the video codec, I tried just a simple
ffmpeg -i input.3gp output.mp4

No matter what I try, for a 10 MB 3gp video I am getting a 5 MB mp4 video that doesn't seem to have the same quality.
Any suggestions are welcome.
Thank you.
EDIT
Here's what I get if I try to copy the Video and Audio codecs:
ffmpeg -i  VIDEO0004.3gp  -c:v copy -c:a copy VIDEO0004.mp4
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VIDEO0004.3gp':
  Metadata:
    major_brand     : 3gp4
    minor_version   : 768
    compatible_brands: 3gp4mp413gp6
    creation_time   : 2011-02-06T16:39:49.000000Z
    copyright       : 
    copyright-eng   : 
    rating          : 0
    location-eng    : +00.0000+000.0000/??
    location        : +00.0000+000.0000/??
  Duration: 00:01:00.20, start: 0.000000, bitrate: 1369 kb/s
  Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1355 kb/s, 9.90 fps, 9.92 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2011-02-06T16:39:49.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)
    Metadata:
      creation_time   : 2011-02-06T16:39:49.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[mp4 @ 0x7fbaf5009600] Could not find tag for codec amr_nb in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --

**Tags:** ffmpeg, mp4, conversion, lossless


---

## 1 answers

### Answer by username_1 on 2021-05-05. Score: 7 | Accepted answer

If the codecs of your input file are already h264 and aac for video and audio, respectively, you can just copy without decoding and encoding again.
ffmpeg -i input.3gp -c:v copy -c:a copy output.mp4

The options -c:v copy and -c:a copy indicate video and audio won't be encoded again, respectively. If audio format in the input cannot be embedded to the output, you need to omit -c:a copy from above command.
If you need to encode again, an option -qscale 0 will result similar quality (but not lossless).
below is an example.
You might combine with -c:v copy or -c:a copy if you don't need to encode video or audio again.
ffmpeg -i input.3gp -qscale 0 output.mp4

> **Comments:**
> **username_0**: Please check my edited question to see what I get if I try to copy video and audio.  
> **username_1**: According to your error message, the audio need to be encoded again. Fortunately, video does not need to be encoded. This command should work `ffmpeg -i input.3gp -c:v copy output.mp4`, which will encode audio but won't encode video.  

---

