Niek / superview

A small program that takes a 4:3 aspect ratio video file, and transforms it to a 16:9 video using the GoPro SuperView method
GNU General Public License v3.0
213 stars 21 forks source link

Bitrate mismatch between source and result video, when not specifying bitrate per parameter #3

Closed qratz closed 5 years ago

qratz commented 5 years ago

Hi,

i used the latest superview release with the ffmepg 4.13 on windows 10. My Input video has the following specs:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source.MP4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 2019-07-05T19:14:43.000000Z
  Duration: 00:07:52.84, start: 0.000000, bitrate: 40804 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 2704x2028, 40483 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2019-07-05T19:14:43.000000Z
      handler_name    :  Ambarella AVC
      encoder         : Ambarella AVC encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2019-07-05T19:14:43.000000Z
      handler_name    :  Ambarella AAC

the resulting video (which has amazing superview look, huge thanks for that!!!) has the following specs:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'superview.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:07:52.84, start: 0.000000, bitrate: 19103 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3604x2028, 18966 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    :  Ambarella AAC

as you can see, the bitrate in the result is 18966 kb/s vs the source's 40804 kb/s. I called superview without the "-b" parameter, so i would expect the resulting bitrate to be around 40804 kb/s as well.

Niek commented 5 years ago

Thanks for the report. Any chance that you can post (part of) the source file so I can investigate?

qratz commented 5 years ago

Sure. Here you go: https://www.dropbox.com/s/8jwdszf2ns4vphc/source_clip.mp4?dl=0

Niek commented 5 years ago

Nice flying :)

I checked, ffprobe lists the video as having 36MB/s average bitrate. You should also see this number in the output when running the superview command. The output file has a similar bitrate for me.

Can you run ffprobe on both the input on output file on your system and post the results?

$ ffprobe -i source_clip.mp4 -v error -show_entries stream=codec_name,bit_rate
[STREAM]
codec_name=h264
bit_rate=38678952
[/STREAM]
[STREAM]
codec_name=aac
bit_rate=128000
[/STREAM]
$ ffprobe -i output.mp4 -v error -show_entries stream=codec_name,bit_rate
[STREAM]
codec_name=h264
bit_rate=38531794
[/STREAM]
[STREAM]
codec_name=aac
bit_rate=128049
[/STREAM]
qratz commented 5 years ago

I already see one difference. You ran superview either on mac or linux. I ran it on Windows with ffmpeg 4.1.3. Also when i ran it superview reported on the cli the following: Filter files generated, re-encoding video at bitrate 0 MB/s Could this be windows specific?

Niek commented 5 years ago

I tested with 4.1.3 (latest version), but it could be that ffprobe outputs the bitrate info differently in other (older?) versions. It would be great if you can put the ffprobe output of the input and output file as above.

Niek commented 5 years ago

Can you check with release v0.2? https://github.com/Niek/superview/releases/tag/v0.2

I changed the way the input specs (among which bitrate) are parsed, it should work better across different ffmpeg/ffprobe versions.

Niek commented 5 years ago

Closing this, I assume it's fixed in 0.2.