← Back to team overview

linux-traipu team mailing list archive

[Bug 1264653] Re: Photo to Full HD video crop and scale width rounding error

 

Hi Cenwen,
thanks for your reply.

I add the copyright protected original photo to this posting for you for testing purposes only.
Copyright (c) 2013 Michael Paul Korthals. All rights reserved.

To play the test video in firefox fails. I do not know why.
Please download the test video to your video folder. 
Select Full HD 1920x1080 screen resolution on your system.
The try some of these commands in a terminal, depending on, which video players you have installed on your system:
(replace %s by the absolute path to the test video)
avplay "%s" -fs
ffplay "%s" -fs
mplayer -fs "%s"
totem --fullscreen "%s"
vlc "%s" -f
On my Ubuntu 13.10 'saucy' it works.

I did not not really understand the 3rd paragraph of you posting and I
feel that I shoud explain my goals to you:

I'm a hobby photographer. I'm inspired to document the beautiness of nature for the future in a timeless way. Here is my open artwork:
http://www.youtube.com/user/MichaelPaulKorthals

My camera is a Cannon 600D (Photo: 18 megapixels; Video: 1080p 40MB
bitrate; Audio: Stereo 16bit PCM uncompressed).

Up to know I produced my videos in windows using ImageMagick, ffmpeg,
mencoder using my private production line scripted in AutoIt.

Currently I am working to build up and to maximize the quality of my
private video production line in Linux. My current artwork task list
contains productions of  high quality  videos from my basis material
from Iceland (a lot of more issues) , South of England, Istanbul  and
Austria  ("Danube Meadows National Park" in four seasons).

I now integrated OpenShot into my production line, because it is easily
to use for timeline, crossfades and titles. Thanks for your ingenious
work.

The KeyframeEditor I use for the high quality pre production of clips
and as high quality video export final stage.

My production quality level for video is 1080p lossless .png image
sequence  and for audio lossless 16 bit PCM stereo 48 kHz uncompressed
.wav. My current video export quality level  for the video player is
this:

avprobe version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2007-2013 the Libav developers
  built on Nov  9 2013 19:15:22 with gcc 4.8.1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_4911.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf53.21.1
  Duration: 00:00:27.02, start: 0.000000, bitrate: 39910 kb/s
    Stream #0.0(und): Video: h264 (Main), yuv420p, 1920x1080, 39621 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Stream #0.1(und): Audio: mp3, 48000 Hz, 2 channels, s16, 320 kb/s

Fast rendering is no requirement for me. I have much time to render the
end results. Normally I let render overnight and I enjoy my end result
videos next day at breakfeast time.

Because OpenShot 1.4.3  does not meet my requirements for a comfortable
keyframe editor and the video output quality, I created KeyframeEditor
to reach the quality level, I currently imagine.

My strategic goal is:  Less coding -> more artwork at maximum quality
level Full HD. So I allow you to use the features design and phyton code
I produced for the KeyframeEditor and it's video export final stage to
enhance OpenShot. I would be glad, if OpenShot 2.0 would fullfil my
quality requirements completly. This would be more efficient for me,
because, in this way, I does not need to treat my additional tools any
more.

In this way I'm interested in your OpenShot 2.0 phyton library. May be
it contains some further possibilities I could integrate in my new
private video production line. Where or when I can find it?

Thanks for your hint regarding ffmpeg. I try to determine if to install
ffmpeg rises the quality of OpenShot 1.4.3.

Now I hope to finish my next Iceland video "Iceland Elements - Seeds of
the Wind" in the next weeks. It will be my first work on my new
production line including OpenShot for the first time.

Kind regards
Michael Paul


** Attachment added: "Butterfly 5184x3456 18 megapixels. Copyright (c) 2013 Michael Paul Korthals. All rights reserved."
   https://bugs.launchpad.net/openshot/+bug/1264653/+attachment/3937223/+files/IMG_1303.JPG

-- 
You received this bug notification because you are a member of UBUNTU -
AL - BR, which is subscribed to OpenShot Video Editor.
https://bugs.launchpad.net/bugs/1264653

Title:
  Photo to Full HD video crop and scale width rounding error

Status in OpenShot Video Editor:
  New

Bug description:
  Architecture (64 bits or 32 bits) : 32 bits
  Operating System & version: Ubuntu 13.10 "saucy"
  Installation Method : via Ubuntu Software Center
  Version of Openshot installed : 1.4.3
  BZR Revision used (if any) : None
  MLT/melt version: I do not know, what this mean 
  FFmpeg (i.e.libavcodec) version :  avconv version 0.8.9-6:0.8.9-0ubuntu0.13.10.1
  FFmpeg installation : Not installed.

  This  bug can be by 100% reproduced through following actions:
  1) Set the project default size in the preferences to 1080p 25 fps
  2) Set the default clip length in the prefernces to 7 seconds
  3) Create a new project
  4) Create 3 tracks
  5) Import a soundfile of adequate length seconds duration to track 0
  6) Import 2 black images and a photo (5184x3456 18 megapixel) into the project (track 1 and 2) incl. cross-fades
  7) Edit the clip layout keyframes to zoom in or zoom out the photo in every clip
  8) Export the video using the mp4 (h.264) codec at high quality
  9) Play the buggy video in vlc video player in full screen mode: vlc "<FilePath>" -f

  On the right side of the player pixel column 1920 disappears and
  reappears frequently. If the still file name is displayed by vlc
  player you can see that the whole frame is freqently chattering by one
  pixel from the left to the right and back again.

  This chattering reduces the subjective enjoyment of the viewer by more
  than 66 %. From my point of view, a failure like this is not an
  option. So I ask you to solve this problem before you launch OpenShot
  V.2.0.

  avprobe version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2007-2013 the Libav developers
    built on Nov  9 2013 19:15:22 with gcc 4.8.1
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Test1.mp4':
    Metadata:
      major_brand     : isom
      minor_version   : 512
      compatible_brands: isomiso2avc1mp41
      encoder         : Lavf53.21.1
    Duration: 00:00:11.72, start: 0.000000, bitrate: 7170 kb/s
      Stream #0.0(und): Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 6973 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
      Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, s16, 191 kb/s

  
  This problem is also visible while playing the timeline (preview) within OpenShot.

  This may be a problem within the libav library you use in the OpenShot
  crop and scale function.

  Please have a look on the crop and scale function in my own application KeyframeEditor:
  https://launchpad.net/keyframeeditor

  I detected and reproduced the the same libav problem, when cropping
  and scaling with avconv in KeyframeEditor.

  PROPOSED WORKAROUND:
  I worked around this problem in KeyframeEditor by using ImageMagick for cropping and scaling and to
  give the position and size parameters as exact float values to ImageMagick.

  Test script:
  #!/bin/bash
  #
  # Custom crop and scale method
  #
  # Interface
  echo "Image input path ....: $1"
  echo "Crop width ..........: $2"
  echo "Crop height .........: $3"
  echo "Crop x ..............: $4"
  echo "Crop y ..............: $5"
  echo "Project width .......: $6"
  echo "Project height ......: $7"
  echo "Image output path ...: $8"
  #
  # Note: This script must be capable to overwrite the output path without user interaction.
  # Note: This script must be capable to to overwrite the input path by the output path.
  #
  # Action
  # Using ImageMagick
  convert "$1" -crop "$2x$3+$4+$5" -resize "$6x$7" "$8"
  EXITCODE=$?
  if [ ! "$EXITCODE" == "0" ]; then
     echo "ERROR: convert canceled with exit code $EXITCODE."
     exit 1
  fi
  echo "Complete."
  # Exit
  exit 0

  Inside Keyframe editor I call "convert" only one time and order to
  render the whole clip in one pass. This is more efficient than to call
  convert at cropping every frame.

  See KeyframeEditor.py / object ExportVideoFrame / thread handler
  CropImagesFromPhoto / after elif self.sCropScaleTool == "ImageMagick".

  Currently I bypass this problem within OpenShot 1.4.3 by using the
  methods I described in Chapter III and IV of the KeyframEditor
  tutorial, which is available in the KeyframeEditor README file.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openshot/+bug/1264653/+subscriptions


References