MP4 timelaps is much bigger then MPEG2?

Camera model
Raspberry pi
What is the problem?
After upgrade to version of Octoprint 1.5.0 I made same print (same Gcode) and final timelapse in MP4 is 26,5 MB (previous file in MPEG2 has 16,3 MB)
I wrote about same problem here:


Is there some possibilities how to adjust settings of final MP4 file to reduce of size (bitrate etc.)?
I hope that main benefits of .mp4 files will be smaller size then .mpeg

What did you already try to solve it?

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
Mediainfo of video files:

> General
> Complete name                            : C:\Users\sykoraj\Data\Plocha\Přílohy\2_20201201124826.mp4
> Format                                   : MPEG-4
> Format profile                           : Base Media
> Codec ID                                 : isom (isom/iso2/avc1/mp41)
> File size                                : 26.6 MiB
> Duration                                 : 23 s 880 ms
> Overall bit rate                         : 9 329 kb/s
> Writing application                      : Lavf57.56.101
> 
> Video
> ID                                       : 1
> Format                                   : AVC
> Format/Info                              : Advanced Video Codec
> Format profile                           : High@L3.2
> Format settings, CABAC                   : Yes
> Format settings, ReFrames                : 4 frames
> Codec ID                                 : avc1
> Codec ID/Info                            : Advanced Video Coding
> Duration                                 : 23 s 880 ms
> Bit rate                                 : 9 326 kb/s
> Nominal bit rate                         : 10 000 kb/s
> Width                                    : 640 pixels
> Height                                   : 480 pixels
> Display aspect ratio                     : 4:3
> Frame rate mode                          : Constant
> Frame rate                               : 25.000 FPS
> Color space                              : YUV
> Chroma subsampling                       : 4:2:0
> Bit depth                                : 8 bits
> Scan type                                : Progressive
> Bits/(Pixel*Frame)                       : 1.214
> Stream size                              : 26.5 MiB (100%)
> Writing library                          : x264 core 148 r2748 97eaef2
> Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=10000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
> 
> General
> Complete name                            : C:\Users\sykoraj\Data\Plocha\Přílohy\2_20201124102836.mpg
> Format                                   : MPEG-PS
> File size                                : 16.4 MiB
> Duration                                 : 23 s 440 ms
> Overall bit rate mode                    : Variable
> Overall bit rate                         : 5 867 kb/s
> 
> Video
> ID                                       : 224 (0xE0)
> Format                                   : MPEG Video
> Format version                           : Version 2
> Format profile                           : Main@Main
> Format settings, BVOP                    : No
> Format settings, Matrix                  : Default
> Format settings, GOP                     : N=12
> Duration                                 : 23 s 440 ms
> Bit rate mode                            : Variable
> Bit rate                                 : 5 750 kb/s
> Width                                    : 640 pixels
> Height                                   : 480 pixels
> Display aspect ratio                     : 4:3
> Frame rate                               : 25.000 FPS
> Color space                              : YUV
> Chroma subsampling                       : 4:2:0
> Bit depth                                : 8 bits
> Scan type                                : Progressive
> Compression mode                         : Lossy
> Bits/(Pixel*Frame)                       : 0.749
> Time code of first frame                 : 00:00:00:00
> Time code source                         : Group of pictures header
> GOP, Open/Closed                         : Open
> GOP, Open/Closed of first frame          : Closed
> Stream size                              : 16.1 MiB (98%)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
browser.user_agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
connectivity.connection_check: 8.8.8.8:53
connectivity.connection_ok: true
connectivity.enabled: false
connectivity.online: true
connectivity.resolution_check: octoprint.org
connectivity.resolution_ok: true
env.hardware.cores: 4
env.hardware.freq: 1200
env.hardware.ram: 917016576
env.os.bits: 32
env.os.id: linux
env.os.platform: linux2
env.plugins.pi_support.model: Raspberry Pi 3 Model B Rev 1.2
env.plugins.pi_support.octopi_version: 0.15.1
env.plugins.pi_support.throttle_state: 0x0
env.python.pip: 19.2.3
env.python.version: 2.7.13
env.python.virtualenv: true
octoprint.safe_mode: false
octoprint.version: 1.5.0
printer.firmware: 3DFactories

Thanks
Jan

Under Settings > Timelapse > Advanced you can adjust the bitrate:

OctoLapse also has many more options available for timelapse config.

1 Like

I think I figured this out. It looks like the bitrate of 10K is too high for MPEG2 with the current video format. You have 10K KB/sec set, and this is what the AVC settings are reporting. However, if you look at the Mpeg2 report, you'll see it's set at about 5750 kb/s (I'm guessing this is the default). I haven't tried this, but I would bet if you drop the bitrate to 7K you would start to see the MP4 being smaller.

Thank you @Charlie_Powell to pointing me.
I made some tests and here is result:
same file, same Gcode:
MPEG2 - set bitrate 10000 - file bitrate 5867 kb/s - 16,4 MB
MP4 - set bitrate 10000 - file bitrate 9329 kb/s - 26,6 MB
MP4 - set bitrate 6000 - file bitrate 5618 kb/s - 16,0 MB
MP4 - set bitrate 5000 - file bitrate 4634 kb/s - 12,6 MB

I think for me is 5000 good, but I think it is possible to decrease maybe to bitrate 3000 kb/s.

Anyway strange is that same bitrate is so so same file size - I hope that MP4 save in same bitrate more space.

Octolapse I have already instaled an tested, but I can not find good settings. When I tested I have big impact for printing quality.so I switched off this plugin.
Maybe @FormerLurker if you can help me and show me your favorit setting?

Thanks
Jan

I am happy to help with Octolapse. It can be a bit of a pain to setup, but I have several videos and guides. Have you looked at the getting started guide?

Not yet
Thanks for the tip.

the image at the top of that guide links to a youtube video, btw. Pay close attention to the 'automatic slicer settings' section in particular. Also, if you are using Slic3r or prusa slicer make sure you enable verbose gcode.