0

I had some image sequence and I used them to make a video using FFMpeg. It palyed well on VLC (windows and android) but not on built in android video player. Codec and container info of the video is the following -

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../clg/clg_eq_final_injected.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:12.13, start: 0.000000, bitrate: 9058 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 4096x2048, 9057 kb/s, 24 fps, 24 tbr, 12288 tbn, 24576 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Side data:
      spherical: equirectangular (0.000000/0.000000/0.000000)

I made a workaround by uploading the video on youtube. Then I downloaded it again. It's codec info is following -

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../clg/clg_eq_test.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2020-05-17T08:06:01.000000Z
  Duration: 00:00:12.14, start: 0.000000, bitrate: 738 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 607 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      creation_time   : 2020-05-17T08:06:01.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/17/2020.
    Side data:
      stereo3d: 2D
      spherical: equirectangular (0.000000/0.000000/0.000000)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2020-05-17T08:06:01.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/17/2020.

I noticed that the first video does not have any audio stream (since it's just an image sequence). But youtube arbitrarily added an audio stream. (I tried on android after adding an audio stream with it but no luck) What I know -

  1. Android does not natively support motion JPEG.
  2. H264 is supported by android.

Q1. What is the difference between h264(constrained baseline) vs h264(main) ? Q2. Why the first video is not natively supported on android ? My uploaded youtube video is here.

Ref:

Conversion from mjpeg to mp4 (libx264) with FFmpeg

convert format from yuvj420p to yuv420p

How to create a video from images with FFmpeg?

Community
  • 1
  • 1

2 Answers2

1

My guess is that your first file has an image size of 4096x2048 and bitrate of 9 Mbps (9057 kb/s) which exceeds what Android recommends assuming built-in hardware decoding. Your second file has an image size of 1280x720 and a bitrate of 607 kb/s so within expectations.

VLC has its own software decoder so is not limited to what Android natively supports.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • The link of my video is [here](https://youtu.be/spbsScbg5Ys). I will lower the bitrate. My question is why youtube is saying the image size is 1280 x 720 ? You can download the video from the link and check it. – Soham Samanta Jun 19 '20 at 15:42
  • Ah you are doing 360 deg video. Given how blocky the resolution appears in a PC browser, the file being 1280x720 seems to line up with expectation. Sadly I have no direct experience with 360 video production so I'm not sure what you are asking other than pointing you to the [Youtube upload encoding recommendations](https://support.google.com/youtube/answer/1722171) – Morrison Chang Jun 19 '20 at 20:31
0

You may not have the same issue, but in my case, the problem was that the handler_name cannot be more than 29 characters. To fix, you could try a command like this instead:

ffmpeg -i in.mp4 -c copy -metadata:s handler_name=SoundHandler out.mp4

https://trac.ffmpeg.org/ticket/3623

Zombo
  • 1
  • 62
  • 391
  • 407