[FFmpeg-user] Turning MP3 into MP4 and join with second MP4 file?

Gilles codecomplete at free.fr
Sat Apr 19 13:32:11 CEST 2014


Hello

I have recordings of a radio show, whose first part is only available
as an MP3 audio file while the second parts is available as an MP4
audiovideo file.

I'm using ffmpeg version N-61821-gc05065a on Windows.

I used ffmpeg to turn the MP3 file and a PNG file into an MP4 file,
converted the second MP4 file to match the audiovideo settings of the
first MP4, but it doesn't work and neitherMP4Joiner nor My MP4Box GUI
are able to join the two MP4 files.

****************************************************************

Here's the infos from MediaCodec and the two ffmpeg commands I used:

========== Turning MP3 into MP4 video:
INPUT
Complete name                            : C:\first.half.mp3
Format                                   : MPEG Audio
File size                                : 9.50 MiB
Duration                                 : 10mn 22s
Overall bit rate mode                    : Constant
Overall bit rate                         : 128 Kbps
Writing library                          : LAME3.99r

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Duration                                 : 10mn 22s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 9.50 MiB (100%)
Writing library                          : LAME3.99r
Encoding settings                        : -m j -V 4 -q 3 -lowpass 17
-b 128

ffmpeg.exe -loop 1 -i speaker.png -i first.half.mp3 -shortest -vf
scale=640:480 -c:v libx264 -tune stillimage -c:a copy
radio.show.first.half.mp4

OUTPUT
Complete name                            :
C:\radio.show.first.half.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 13.3 MiB
Duration                                 : 10mn 24s
Overall bit rate                         : 178 Kbps
Writing application                      : Lavf55.35.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:4:4 Predictive at L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10mn 24s
Bit rate                                 : 45.2 Kbps
Width                                    : 640 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.006
Stream size                              : 3.36 MiB (25%)
Writing library                          : x264 core 142 r2409 d6b4e63
Encoding settings                        : cabac=1 / ref=3 /
deblock=1:-3:-3 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 /
psy_rd=2.00:0.70 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1
/ 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=2 / threads=3 / lookahead_threads=1 /
sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0
/ constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0
/ direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 /
keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 /
rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 /
qpstep=4 / ip_ratio=1.40 / aq=1:1.20

Audio
ID                                       : 2
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Codec ID                                 : 6B
Duration                                 : 10mn 22s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 9.50 MiB (72%)


========== Converting MP4 to identical settings found in first file:
INPUT
Complete name                            : C:\second.half.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 118 MiB
Duration                                 : 19mn 41s
Overall bit rate mode                    : Variable
Overall bit rate                         : 835 Kbps
Tagged date                              : UTC 2014-04-17 08:37:51
Writing application                      : Lavf55.19.104

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High at L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 19mn 41s
Bit rate                                 : 700 Kbps
Width                                    : 848 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.069
Stream size                              : 98.5 MiB (84%)
Writing library                          : x264 core 140 r2377M
1ca7bb9

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 19mn 41s
Duration_LastFrame                       : -11ms
Bit rate mode                            : Variable
Bit rate                                 : 128 Kbps
Maximum bit rate                         : 800 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 18.0 MiB (15%)

ffmpeg.exe -i second.half.mp4  -shortest -s:v 640x480 -c:v libx264
-c:a  libmp3lame -b:a 128k -r:a 48000 radio.show.second.half.mp4

OUTPUT:
Complete name                            :
C:\radio.show.second.half.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 69.6 MiB
Duration                                 : 19mn 41s
Overall bit rate                         : 494 Kbps
Writing application                      : Lavf55.35.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High at L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 19mn 41s
Bit rate                                 : 359 Kbps
Width                                    : 640 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.047
Stream size                              : 50.5 MiB (73%)
Writing library                          : x264 core 142 r2409 d6b4e63
Encoding settings                        : cabac=1 / ref=3 /
deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 /
psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1
/ 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 /
sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0
/ constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0
/ direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 /
keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 /
rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 /
qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Audio
ID                                       : 2
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Codec ID                                 : 6B
Duration                                 : 19mn 41s
Duration_LastFrame                       : -1ms
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 18.0 MiB (26%)
Writing library                          : LAME3.99.5

****************************************************************

The first file:
aspect ratio 4:3
sample frequency 48000Hz

The second file:
aspect ratio 1:1,77
sample frequency 44100Hz

Any help appreciated,
Thank you.



More information about the ffmpeg-user mailing list