[FFmpeg-user] MTS to MP4 lossless conversion issues

Karen Norton nortok00 at gmail.com
Thu Aug 3 12:10:20 EEST 2017


Adding to my previous message.... you could also encode to something like
mp3 for audio which is also supported across most devices and players. I
feel aac is a better encoder but I think for most people the difference
would hardly be noticeable. From everything I read about libvo_aacenc I
think for most purposes it's pretty close to aac so I don't know that you
would notice much difference if you had to stay with that encoder.

As mentioned though others with experience in ubuntu (assuming you're on
that) might have ways to get aac going with your version of ffmpeg.

I hope this helps.

Cheers.

On Thu, Aug 3, 2017 at 4:29 AM, akash kulkarni <kul.akash123 at gmail.com>
wrote:

> ffmpeg -i input -c:v copy -c:a aac -b:a 256k output.mp4
>
> while executing
>
> it gaves me error saying
> [aac @ 0000000002a802e0]
>                 The encoder 'aac' is experimental but experimental codecs
> are not enabled, add '-strict -2' if you want to use it.
> [aac @ 0000000002a802e0]
>                  Alternatively use the non experimental encoder
> 'libvo_aacenc'.
>
> So i used
>                 ffmpeg -i input.MTS -c:v copy -c:a libvo_aacenc -b:a 256k
> mp4fro output.mp4
>
> and it works .
>
>
> i am just curious to know why aac is not working with my version of ffmpeg
>
> [ ffmpeg Details :]
>
>
> ffmpeg version 2.0.2 Copyright (c) 2000-2013 the FFmpeg developers
>   built on Oct 26 2013 06:29:32 with gcc 4.8.2 (GCC)
>   configuration: --disable-static --enable-shared --enable-gpl
> --enable-version3
>  --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig
> --ena
> ble-frei0r --enable-gnutls --enable-iconv --enable-libass
> --enable-libbluray --e
> nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc
> --enable-lib
> modplug --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrw
> b --enable-libopenjpeg --enable-libopus --enable-librtmp
> --enable-libschroedinge
> r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
> --en
> able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
> --enable-libvorbis
>  --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs
> --enable-
> libxvid --enable-zlib
>   libavutil      52. 38.100 / 52. 38.100
>   libavcodec     55. 18.102 / 55. 18.102
>   libavformat    55. 12.100 / 55. 12.100
>   libavdevice    55.  3.100 / 55.  3.100
>   libavfilter     3. 79.101 /  3. 79.101
>   libswscale      2.  3.100 /  2.  3.100
>   libswresample   0. 17.102 /  0. 17.102
>   libpostproc    52.  3.100 / 52.  3.100
>
>
>
> so any one can explain how i can make aac codec working with my ffmpeg
>
>
> On Thu, Aug 3, 2017 at 1:26 PM, Karen Norton <nortok00 at gmail.com> wrote:
>
> > Hi all,
> >
> > I'm not entirely sure where this was left off but thought I would weigh
> in.
> > I looked at what your output stream is for audio and unless I'm reading
> it
> > wrong it looks like it's ac3. I had the same issues with ac3 and windows
> > media player. VLC played the video fine. WMP played the video but there
> was
> > no audio. This of course is unrelated to ffmpeg. Supposedly some versions
> > of WMP don't have the ac-3 filter enabled which is why it works in VLC
> but
> > not WMP. There are fixes for this by googling "windows media player and
> ac3
> > support". I still had issues even after trying some of these fixes so
> just
> > decided to re-encode with AVC for video and AAC for audio which seems to
> > provide the greatest amount of support across all devices, players, etc.
> I
> > do this for all of my videos now and will (at some point) go back and do
> my
> > entire library.
> >
> > Hopefully this helps and if this has already been resolved then apologies
> > for adding another email to the thread. :-)
> >
> > Cheers.
> >
> > On Thu, Aug 3, 2017 at 1:45 AM, akash kulkarni <kul.akash123 at gmail.com>
> > wrote:
> >
> > > i have some same kinda of problem,where i am converting MTS file to
> MP4 .
> > >
> > > problem is about audio is not playing in widows media player while it
> > > playing well in VLC
> > > so how could i convert mts to mp4 to play that mp4 file well in Windows
> > > media player
> > > please can you tell me ffmpeg command format to do so
> > >
> > > On Wed, Jul 12, 2017 at 8:46 PM, Nick Gilmour <nickeforos at gmail.com>
> > > wrote:
> > >
> > > > Thanks for the reponses!
> > > >
> > > >
> > > >
> > > > *What is the output of$ ffmpeg -i 00000.ffmpeg1.mp4??*
> > > >
> > > > ffmpeg version 3.3.2-1~16.04.york1 Copyright (c) 2000-2017 the FFmpeg
> > > > developers
> > > >   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
> > > >   configuration: --prefix=/usr --extra-version='1~16.04.york1'
> > > > --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
> > > > --incdir=/usr/include/x86_64-linux-gnu --enable-gpl
> > --disable-stripping
> > > > --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
> > > > --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
> > > > --enable-libcdio --enable-libflite --enable-libfontconfig
> > > > --enable-libfreetype --enable-libfribidi --enable-libgme
> > --enable-libgsm
> > > > --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt
> > > > --enable-libopus --enable-libpulse --enable-librubberband
> > > --enable-libshine
> > > > --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
> > > > --enable-libtheora --enable-libtwolame --enable-libvorbis
> > --enable-libvpx
> > > > --enable-libwavpack --enable-libwebp --enable-libx265
> --enable-libxvid
> > > > --enable-libzmq --enable-libzvbi --enable-omx --enable-openal
> > > > --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883
> > > > --enable-chromaprint --enable-frei0r --enable-libopencv
> > --enable-libx264
> > > > --enable-shared
> > > >   WARNING: library configuration mismatch
> > > >   avcodec     configuration: --prefix=/usr --extra-version='1~16.04.
> > > york1'
> > > > --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
> > > > --incdir=/usr/include/x86_64-linux-gnu --enable-gpl
> > --disable-stripping
> > > > --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
> > > > --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
> > > > --enable-libcdio --enable-libflite --enable-libfontconfig
> > > > --enable-libfreetype --enable-libfribidi --enable-libgme
> > --enable-libgsm
> > > > --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt
> > > > --enable-libopus --enable-libpulse --enable-librubberband
> > > --enable-libshine
> > > > --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
> > > > --enable-libtheora --enable-libtwolame --enable-libvorbis
> > --enable-libvpx
> > > > --enable-libwavpack --enable-libwebp --enable-libx265
> --enable-libxvid
> > > > --enable-libzmq --enable-libzvbi --enable-omx --enable-openal
> > > > --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883
> > > > --enable-chromaprint --enable-frei0r --enable-libopencv
> > --enable-libx264
> > > > --enable-shared --enable-version3 --disable-doc --disable-programs
> > > > --enable-libopencore_amrnb --enable-libopencore_amrwb
> > > --enable-libtesseract
> > > > --enable-libvo_amrwbenc --enable-netcdf
> > > >   libavutil      55. 58.100 / 55. 58.100
> > > >   libavcodec     57. 89.100 / 57. 89.100
> > > >   libavformat    57. 71.100 / 57. 71.100
> > > >   libavdevice    57.  6.100 / 57.  6.100
> > > >   libavfilter     6. 82.100 /  6. 82.100
> > > >   libavresample   3.  5.  0 /  3.  5.  0
> > > >   libswscale      4.  6.100 /  4.  6.100
> > > >   libswresample   2.  7.100 /  2.  7.100
> > > >   libpostproc    54.  5.100 / 54.  5.100
> > > > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '00000.mp4':
> > > >   Metadata:
> > > >     major_brand     : isom
> > > >     minor_version   : 512
> > > >     compatible_brands: isomiso2avc1mp41
> > > >     encoder         : Lavf57.71.100
> > > >   Duration: 00:00:15.10, start: 0.000000, bitrate: 12936 kb/s
> > > >     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
> > > yuv420p(tv),
> > > > 1280x720 [SAR 1:1 DAR 16:9], 12760 kb/s, 25 fps, 25 tbr, 90k tbn, 100
> > tbc
> > > > (default)
> > > >     Metadata:
> > > >       handler_name    : VideoHandler
> > > >     Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz,
> stereo,
> > > > fltp, 192 kb/s (default)
> > > >     Metadata:
> > > >       handler_name    : SoundHandler
> > > >     Side data:
> > > >       audio service type: main
> > > > At least one output file must be specified
> > > >
> > > > I have rerun the command and now I'm getting a WARNING: library
> > > > configuration mismatch. I thinks it's because the Software Center
> > forced
> > > me
> > > > to remove a package...
> > > >
> > > >
> > > > *Subtitles? Interesting, what do they contain? :)*
> > > >
> > > > Actually there are no subtitles. This is weird...
> > > >
> > > > To me this AVCHD format is uncomfortable. How am I supposed to
> separate
> > > the
> > > > files? I want to have everything in a single file. Anyway, I have
> > decided
> > > > to convert the MTS files to mp4 and keep the AVCHD structure as a
> > > backup. I
> > > > see no quality loss with the generated mp4.
> > > >
> > > >
> > > > On Tue, Jul 11, 2017 at 1:34 PM, Moritz Barsnick <barsnick at gmx.net>
> > > wrote:
> > > >
> > > > > On Mon, Jul 10, 2017 at 15:03:49 +0200, Nick Gilmour wrote:
> > > > > > *track 1: codec frame size is not set*
> > > > > > 1. I googled also about this but I still don't know what does
> that
> > > mean
> > > > > and
> > > > > > how I should deal with it. Is it an error or should I change
> > > something?
> > > > >
> > > > > It about the audio track and I think it shouldn't matter. (I don't
> > know
> > > > > absolutely for sure though.)
> > > > >
> > > > > > 2. I also see with VLC > Tools > Codec Information that the
> output
> > > file
> > > > > has
> > > > > > 25 frames per sec, whereas the input file has 50 frames per sec.
> > This
> > > > > > although the output of the previous command shows 50 fps for the
> > > output
> > > > > > file. So what is going on? Is VLC wrong? How can I get the 50 fps
> > in
> > > > the
> > > > > > output file? Do 25 fps less mean reduced quality?
> > > > >
> > > > > If you copy the stream ("-c[:x] copy"), no quality is reduced.
> > > > >
> > > > > VLC may be wrong. See this (from the input):
> > > > > >     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
> > > > > yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 25
> > tbr,
> > > > 90k
> > > > > tbn, 100 tbc
> > > > >
> > > > > "50 fps" is the frame rate given by the demuxer, "25 tbr" is the
> > frame
> > > > > rate guessed (by ffmpeg) from actual packets' timestamps. If you
> dump
> > > > > all frames' info with ffprobe, we could double-check this
> conclusion.
> > > > >
> > > > > I don't understand why VLC sees differences in the two files
> though.
> > It
> > > > > would be interesting to see what the container vs. stream metadata
> > > > > says. It could be ffmpeg is adding info to the MP4 which the MTS
> just
> > > > > didn't have (because it e.g. only has per-stream metadata). Or
> > > > > something like that.
> > > > >
> > > > > What is the output of
> > > > > $ ffmpeg -i 00000.ffmpeg1.mp4
> > > > > ??
> > > > >
> > > > > Can you provide such an MTS sample? (As short as possibly, but able
> > to
> > > > > reproduce the issue.)
> > > > >
> > > > > > 3. The AVCHD format comes also with other files except MTS e.g.
> > CPI.
> > > > Are
> > > > > > these important for the conversion or for use with video editing
> > > tools
> > > > > > like Kdenlive?
> > > > >
> > > > > The CPI file apparently holds extra metadata, but ffmpeg can't make
> > use
> > > > > of it. Final Cut Pro and iMovie apparently can. (I keep writing
> > > > > "apparently", because I googled. Did you?
> > > > > http://www.pavtube.com/avchd-cpi-file-format.html)
> > > > >
> > > > > >     Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle
> > ([144][0][0][0]
> > > /
> > > > > 0x0090), 1280x720
> > > > >
> > > > > Subtitles? Interesting, what do they contain? :)
> > > > >
> > > > > > Regards
> > > > > > Nick
> > > > >
> > > > > Cheers,
> > > > > Moritz
> > > > >
> > > > >
> > > > > > $ ffmpeg -i 00000.MTS -vcodec copy -acodec copy -sn
> > 00000.ffmpeg1.mp4
> > > > > > ffmpeg version 3.3.2-1~16.04.york1 Copyright (c) 2000-2017 the
> > FFmpeg
> > > > > developers
> > > > > >   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
> > > > > >   configuration: --prefix=/usr --extra-version='1~16.04.york1'
> > > > > --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
> > > > > --incdir=/usr/include/x86_64-linux-gnu --enable-gpl
> > > --disable-stripping
> > > > > --enable-avresample --enable-avisynth --enable-gnutls
> --enable-ladspa
> > > > > --enable-libass --enable-libbluray --enable-libbs2b
> --enable-libcaca
> > > > > --enable-libcdio --enable-libflite --enable-libfontconfig
> > > > > --enable-libfreetype --enable-libfribidi --enable-libgme
> > > --enable-libgsm
> > > > > --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt
> > > > > --enable-libopus --enable-libpulse --enable-librubberband
> > > > --enable-libshine
> > > > > --enable-libsnappy --enable-libsoxr --enable-libspeex
> --enable-libssh
> > > > > --enable-libtheora --enable-libtwolame --enable-libvorbis
> > > --enable-libvpx
> > > > > --enable-libwavpack --enable-libwebp --enable-libx265
> > --enable-libxvid
> > > > > --enable-libzmq --enable-libzvbi --enable-omx --enable-openal
> > > > > --enable-opengl --enable-sdl2 --enable-libdc1394
> --enable-libiec61883
> > > > > --enable-chromaprint --enable-frei0r --enable-libopencv
> > > --enable-libx264
> > > > > --enable-shared
> > > > > >   libavutil      55. 58.100 / 55. 58.100
> > > > > >   libavcodec     57. 89.100 / 57. 89.100
> > > > > >   libavformat    57. 71.100 / 57. 71.100
> > > > > >   libavdevice    57.  6.100 / 57.  6.100
> > > > > >   libavfilter     6. 82.100 /  6. 82.100
> > > > > >   libavresample   3.  5.  0 /  3.  5.  0
> > > > > >   libswscale      4.  6.100 /  4.  6.100
> > > > > >   libswresample   2.  7.100 /  2.  7.100
> > > > > >   libpostproc    54.  5.100 / 54.  5.100
> > > > > > Input #0, mpegts, from '00000.MTS':
> > > > > >   Duration: 00:00:15.10, start: 0.888889, bitrate: 13700 kb/s
> > > > > >   Program 1
> > > > > >     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
> > > > > yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 25
> > tbr,
> > > > 90k
> > > > > tbn, 100 tbc
> > > > > >     Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000
> Hz,
> > > > > stereo, fltp, 192 kb/s
> > > > > >     Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle
> > ([144][0][0][0]
> > > /
> > > > > 0x0090), 1280x720
> > > > > > [mp4 @ 0x55a37b91a4a0] track 1: codec frame size is not set
> > > > > > Output #0, mp4, to '00000.ffmpeg1.mp4':
> > > > > >   Metadata:
> > > > > >     encoder         : Lavf57.71.100
> > > > > >     Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021),
> > > > > yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 50
> > fps,
> > > 25
> > > > > tbr, 90k tbn, 90k tbc
> > > > > >     Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz,
> > > > stereo,
> > > > > fltp, 192 kb/s
> > > > > > Stream mapping:
> > > > > >   Stream #0:0 -> #0:0 (copy)
> > > > > >   Stream #0:1 -> #0:1 (copy)
> > > > > > Press [q] to stop, [?] for help
> > > > > > frame=  377 fps=0.0 q=-1.0 Lsize=   23852kB time=00:00:15.07
> > > > > bitrate=12964.2kbits/s speed= 247x
> > > > > > video:23490kB audio:354kB subtitle:0kB other streams:0kB global
> > > > > headers:0kB muxing overhead: 0.033670%
> > > > >
> > > > > > _______________________________________________
> > > > > > ffmpeg-user mailing list
> > > > > > ffmpeg-user at ffmpeg.org
> > > > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > >
> > > > > > To unsubscribe, visit link above, or email
> > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > >
> > > > > _______________________________________________
> > > > > ffmpeg-user mailing list
> > > > > ffmpeg-user at ffmpeg.org
> > > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > >
> > > > > To unsubscribe, visit link above, or email
> > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > >
> > > > _______________________________________________
> > > > ffmpeg-user mailing list
> > > > ffmpeg-user at ffmpeg.org
> > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > >
> > > > To unsubscribe, visit link above, or email
> > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > >
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> >
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list