Convert iPhone MOV to Android MP4
I would've thought that this was a FAQ, but I have been unable to find it. I'm emailing this list because many solutions I find online still reference "-strict experimental" for AAC output. I would like to convert iPhone videos to MP4, and would like to retain the input audio bitrate and sampling rate. I had the impression that this would be the default behavior if the values weren't specified on the command line, but I've seen that this isn't the case. I will follow up this email with sample output.
From what I can tell of the following output, the input audio bitrate is 85 kb/s, and the output is 69 kb/s.
I would like to know if it's possible to retain the source audio bitrate. I am doing this via a batch file that loops through iPhone videos that have varying bitrates. E:\> ffmpeg.exe -i 100APPLE\IMG_0075.MOV -vcodec copy -acodec aac C:..\iPhone\DCIM\IMG_0075.MP4 ffmpeg version N-83749-g035e932 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib libavutil 55. 47.101 / 55. 47.101 libavcodec 57. 82.100 / 57. 82.100 libavformat 57. 66.103 / 57. 66.103 libavdevice 57. 3.100 / 57. 3.100 libavfilter 6. 74.100 / 6. 74.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '100APPLE\IMG_0075.MOV': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-11-14T04:40:23.000000Z com.apple.quicktime.location.ISO6709: +31.7344-106.3326+1142.097/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 10.1.1 com.apple.quicktime.creationdate: 2016-11-13T21:40:23-0700 Duration: 00:00:03.84, start: -0.000023, bitrate: 11797 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 11689 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default) Metadata: rotate : 90 creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 85 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream #0:2(und): Data: none (mebx / 0x7862656D), 5 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mp4, to 'C:..\iPhone\DCIM\IMG_0075.MP4': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt com.apple.quicktime.creationdate: 2016-11-13T21:40:23-0700 com.apple.quicktime.location.ISO6709: +31.7344-106.3326+1142.097/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 10.1.1 encoder : Lavf57.66.103 Stream #0:0(und): Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(tv, bt709), 1920x1080, q=2-31, 11689 kb/s, 29.97 fps, 29.97 tbr, 19200 tbn, 600 tbc (default) Metadata: rotate : 90 creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 69 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : Lavc57.82.100 aac frame= 115 fps=0.0 q=-1.0 Lsize= 5512kB time=00:00:03.85 bitrate=11715.4kbits/s speed=55.1x video:5475kB audio:33kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.084008% [aac @ 00000000004ab940] Qavg: 1297.159 On Wed, Mar 8, 2017 at 9:41 AM, Richard Duran <ricdur2@gmail.com> wrote:
I would've thought that this was a FAQ, but I have been unable to find it. I'm emailing this list because many solutions I find online still reference "-strict experimental" for AAC output.
I would like to convert iPhone videos to MP4, and would like to retain the input audio bitrate and sampling rate. I had the impression that this would be the default behavior if the values weren't specified on the command line, but I've seen that this isn't the case.
I will follow up this email with sample output.
Hi there, Does anyone already experienced a wrong aspect ratio when encoding h264(sd, 4:3) into an mxf container? Using ffmpeg,it always sets the container aspect ratio to 16:9... Rewrapping using ffmbc=>ok. Thank's for help. Philippe. -----Message d'origine----- De : ffmpeg-user [mailto:ffmpeg-user-bounces@ffmpeg.org] De la part de Richard Duran Envoyé : mercredi 8 mars 2017 17:56 À : FFmpeg user questions Objet : Re: [FFmpeg-user] Convert iPhone MOV to Android MP4
From what I can tell of the following output, the input audio bitrate is 85 kb/s, and the output is 69 kb/s.
I would like to know if it's possible to retain the source audio bitrate. I am doing this via a batch file that loops through iPhone videos that have varying bitrates. E:\> ffmpeg.exe -i 100APPLE\IMG_0075.MOV -vcodec copy -acodec aac C:..\iPhone\DCIM\IMG_0075.MP4 ffmpeg version N-83749-g035e932 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib libavutil 55. 47.101 / 55. 47.101 libavcodec 57. 82.100 / 57. 82.100 libavformat 57. 66.103 / 57. 66.103 libavdevice 57. 3.100 / 57. 3.100 libavfilter 6. 74.100 / 6. 74.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '100APPLE\IMG_0075.MOV': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-11-14T04:40:23.000000Z com.apple.quicktime.location.ISO6709: +31.7344-106.3326+1142.097/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 10.1.1 com.apple.quicktime.creationdate: 2016-11-13T21:40:23-0700 Duration: 00:00:03.84, start: -0.000023, bitrate: 11797 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 11689 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default) Metadata: rotate : 90 creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 85 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream #0:2(und): Data: none (mebx / 0x7862656D), 5 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mp4, to 'C:..\iPhone\DCIM\IMG_0075.MP4': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt com.apple.quicktime.creationdate: 2016-11-13T21:40:23-0700 com.apple.quicktime.location.ISO6709: +31.7344-106.3326+1142.097/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 10.1.1 encoder : Lavf57.66.103 Stream #0:0(und): Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(tv, bt709), 1920x1080, q=2-31, 11689 kb/s, 29.97 fps, 29.97 tbr, 19200 tbn, 600 tbc (default) Metadata: rotate : 90 creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 69 kb/s (default) Metadata: creation_time : 2016-11-14T04:40:23.000000Z handler_name : Core Media Data Handler encoder : Lavc57.82.100 aac frame= 115 fps=0.0 q=-1.0 Lsize= 5512kB time=00:00:03.85 bitrate=11715.4kbits/s speed=55.1x video:5475kB audio:33kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.084008% [aac @ 00000000004ab940] Qavg: 1297.159 On Wed, Mar 8, 2017 at 9:41 AM, Richard Duran <ricdur2@gmail.com> wrote:
I would've thought that this was a FAQ, but I have been unable to find it. I'm emailing this list because many solutions I find online still reference "-strict experimental" for AAC output.
I would like to convert iPhone videos to MP4, and would like to retain the input audio bitrate and sampling rate. I had the impression that this would be the default behavior if the values weren't specified on the command line, but I've seen that this isn't the case.
I will follow up this email with sample output.
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
On Wed, Mar 08, 2017 at 18:16:52 +0100, Phillipe Laterrade wrote:
Subject: Re: [FFmpeg-user] Convert iPhone MOV to Android MP4 Does anyone already experienced a wrong aspect ratio when encoding h264(sd, 4:3) into an mxf container? Using ffmpeg,it always sets the container aspect ratio to 16:9... Rewrapping using ffmbc=>ok.
What does this have to do with the Subject: line, and the thread you're replying to? For a new topic, please open a new thread with a proper subject, and *not* by answering to an existing email. To get to the real topic (which I know little about): Please demonstrate your issue by providing the full ffmpeg command line you're using, and also its complete, uncut console output. Please also show or explain how you checked that the aspect ratio is incorrect. (Please don't reply to this either, but compose a new thread with the reqested information.) Thanks, Moritz
2017-03-08 17:56 GMT+01:00 Richard Duran <ricdur2@gmail.com>:
From what I can tell of the following output, the input audio bitrate is 85 kb/s, and the output is 69 kb/s.
I would like to know if it's possible to retain the source audio bitrate. I am doing this via a batch file that loops through iPhone videos that have varying bitrates.
E:\> ffmpeg.exe -i 100APPLE\IMG_0075.MOV -vcodec copy -acodec aac C:..\iPhone\DCIM\IMG_0075.MP4
Since your input already have aac audio, and you're already copying the video stream as-is, why not just "-codec copy" and be done with it? If you specify "-acodec aac" it will do a transcode, taking time, and use default values, which is obviously not what you want. Also, if you do want to transcode from aac to aac, there's no much point in trying to keep the same bitrate; it'll be lossy anyway.
The output I provided just happened to be one of the very few that used AAC, and what I was using to compare bitrates. Most of my videos use pcm_s16le, which I am understanding is not supported in MP4, and thus the reason I am converting everything to AAC by default. Example #2, input with pcm_s16le, input bitrate of 705 kb/s. Output bitrate defaults to 69 kb/s. I would have expected the output bitrate to match that of the input. Does AAC support that high of a bitrate? ffmpeg version N-83749-g035e932 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (GCC) configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib libavutil 55. 47.101 / 55. 47.101 libavcodec 57. 82.100 / 57. 82.100 libavformat 57. 66.103 / 57. 66.103 libavdevice 57. 3.100 / 57. 3.100 libavfilter 6. 74.100 / 6. 74.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Guessed Channel Layout for Input Stream #0.1 : mono Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '100APPLE\IMG_0010.MOV': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2016-07-19T18:42:38.000000Z com.apple.quicktime.content.identifier: 3118A852-CBA8-488D-9868-F883D5A19A73 com.apple.quicktime.location.ISO6709: +31.7345-106.3326+1141.214/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 9.3.1 com.apple.quicktime.creationdate: 2016-07-19T12:42:38-0600 Duration: 00:00:02.67, start: 0.000000, bitrate: 8695 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1440x1080, 7965 kb/s, 12.38 fps, 15 tbr, 600 tbn, 1200 tbc (default) Metadata: rotate : 90 creation_time : 2016-07-19T18:42:38.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: pcm_s16le (lpcm / 0x6D63706C), 44100 Hz, mono, s16, 705 kb/s (default) Metadata: creation_time : 2016-07-19T18:42:38.000000Z handler_name : Core Media Data Handler Stream #0:2(und): Data: none (mebx / 0x7862656D), 43 kb/s (default) Metadata: creation_time : 2016-07-19T18:42:38.000000Z handler_name : Core Media Data Handler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, mp4, to 'C:..\iPhone\DCIM\IMG_0010.MP4': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt com.apple.quicktime.creationdate: 2016-07-19T12:42:38-0600 com.apple.quicktime.content.identifier: 3118A852-CBA8-488D-9868-F883D5A19A73 com.apple.quicktime.location.ISO6709: +31.7345-106.3326+1141.214/ com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 6s Plus com.apple.quicktime.software: 9.3.1 encoder : Lavf57.66.103 Stream #0:0(und): Video: h264 (High) ([33][0][0][0] / 0x0021), yuvj420p(pc, smpte170m/bt709/bt709), 1440x1080, q=2-31, 7965 kb/s, 12.38 fps, 15 tbr, 19200 tbn, 600 tbc (default) Metadata: rotate : 90 creation_time : 2016-07-19T18:42:38.000000Z handler_name : Core Media Data Handler encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 69 kb/s (default) Metadata: creation_time : 2016-07-19T18:42:38.000000Z handler_name : Core Media Data Handler encoder : Lavc57.82.100 aac frame= 27 fps=0.0 q=-1.0 Lsize= 2334kB time=00:00:02.67 bitrate=7160.8kbits/s speed=18.8x video:2309kB audio:23kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.095816% [aac @ 000000000048dfc0] Qavg: 110.545 On Wed, Mar 8, 2017 at 11:21 AM, Cley Faye <cleyfaye@gmail.com> wrote:
2017-03-08 17:56 GMT+01:00 Richard Duran <ricdur2@gmail.com>:
From what I can tell of the following output, the input audio bitrate is 85 kb/s, and the output is 69 kb/s.
I would like to know if it's possible to retain the source audio bitrate. I am doing this via a batch file that loops through iPhone videos that have varying bitrates.
E:\> ffmpeg.exe -i 100APPLE\IMG_0075.MOV -vcodec copy -acodec aac C:..\iPhone\DCIM\IMG_0075.MP4
Since your input already have aac audio, and you're already copying the video stream as-is, why not just "-codec copy" and be done with it?
If you specify "-acodec aac" it will do a transcode, taking time, and use default values, which is obviously not what you want. Also, if you do want to transcode from aac to aac, there's no much point in trying to keep the same bitrate; it'll be lossy anyway. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2017-03-08 23:06 GMT+01:00 Richard Duran <ricdur2@gmail.com>:
Example #2, input with pcm_s16le, input bitrate of 705 kb/s. Output bitrate defaults to 69 kb/s. I would have expected the output bitrate to match that of the input. Does AAC support that high of a bitrate?
What are you trying to do and to what end? Matching the bitrates between pcm (uncompressed) and AAC (lossy compression) doesn't make much sense.
participants (4)
-
Cley Faye -
Moritz Barsnick -
Phillipe Laterrade -
Richard Duran