[FFmpeg-user] Converting from one video format to another

Micael Silva micaelsilva at gmail.com
Thu Oct 28 01:43:38 EEST 2021



On 27 Oct 2021, at 19:38, Patrick Mahan <mahan at mahan.org> wrote:

Greetings,

I am just getting started with some video processing, etc.  However, I have a need to run on a iOS device or Mac OS X.  I have VLC but I need to be able to use iOS apps to play these videos, but QuickTime barfs on them.

They seem to play okay if I media serve them out to the iOS device, but I do need to get them to play on QuickTime.

The original videos are MPEG-H Part 2/HEVC (H265).  Here is the output of ffprobe <video.mp4> -hide_banner:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Video1.mp4':
 Metadata:
   major_brand     : mp42
   minor_version   : 0
   compatible_brands: mp42mp41
   creation_time   : 2021-10-24T23:18:14.000000Z
 Duration: 00:07:24.31, start: 0.000000, bitrate: 16553 kb/s
   Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 16357 kb/s, 60 fps, 60 tbr, 60k tbn, 60 tbc (default)
   Metadata:
     creation_time   : 2021-10-24T23:18:14.000000Z
     handler_name    : ?Mainconcept Video Media Handler
     encoder         : HEVC Coding
   Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
   Metadata:
     creation_time   : 2021-10-24T23:18:14.000000Z
     handler_name    : #Mainconcept MP4 Sound Media Handler

QT simply gives up and says it cannot play this video.  VLC has no problems.

I attempted to convert to H.264, thinking that might be the issue using the ffmpeg command:

   ffmpeg -i Video1.mp4 -bsf:v h264_mp4toannexb -sn -map 0:0 -map 0:1 -vcodec libx264 Video1.ts

However, QuickTime, again, barfs while VLC works just fine.  When I look at the covered file using ffprobe I see -

Input #0, mpegts, from 'Video1.ts':
 Duration: 00:07:24.28, start: 1.423311, bitrate: 6129 kb/s
 Program 1
   Metadata:
     service_name    : Service01
     service_provider: FFmpeg
   Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 90k tbn, 120 tbc
   Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s

So I am unsure what needs to happen to get QuickTime to grok it (QuickTime is not saying why it won't open).  Is it the audio?  converting form aac to mp2?
________________________________



Keep using H264 but make sure that the audio codec is AAC and the wrapper is MP4 not MPEGTS



More information about the ffmpeg-user mailing list