Openshot-qt: OpenShot exporting -> Does it use Ffmpeg?

Created on 17 Jul 2019  Â·  8Comments  Â·  Source: OpenShot/openshot-qt

Hi,

I'm wondering about how OpenShot exports its project files. Does it use the Ffmpeg program for exporting its videos (such as hinted here: https://www.openshot.org/en/blog/2010/09/27/export-html5-webm-video-format/) or does it export the file using its own written export program?

I downloaded Ffmpeg, used the command line but it couldn't read the project file, while OpenShot can read it.

Thanks!

question

All 8 comments

@bmfb46680

OpenShot uses libopenshot as its video backend. It provides the overall project timeline for the editing process, as well as management for multiple media sources, compositing, effects, transitions, etc.

libopenshot is linked with the FFmpeg libraries directly, and does use them for both reading and writing video and audio streams. It doesn't use the ffmpeg executable itself for anything, though.

OpenShot project files are JSON descriptions of the timeline in a format libopenshot can process, they're metadata only, and can't be read by anything but OpenShot. (I mean, they're just text files, so _anything_ can read them... but anything other than OpenShot wouldn't know what to do with the information contained inside.)

Hope this answers your question!

Hi @ferdnyc,
Thank you for the fast reply.
I don't understand your explanation completely. It does use the Ffmpeg libraries and the way it encodes files, but can't read the Openshot project files?

I've read the following statement:
"FFmpeg (libavformat, libavcodec, libavutil, libavdevice, libavresample, libswscale)
http://www.ffmpeg.org/ (Library)
This library is used to decode and encode video, audio, and image files. It is also used to obtain information about media files, such as frame rate, sample rate, aspect ratio, and other common attributes." - https://github.com/OpenShot/libopenshot/blob/develop/INSTALL.md

So if I guess it correctly, Openshot or Libopenshot uses Fmpeg, but encodes it before Ffmpeg can encode it to .mp4?

Would I ever be able to use some kind of light weight export function for OpenShot projects?

Again, the support is appreciated, are you a developer as well on Openshot?

It does use the Ffmpeg libraries and the way it encodes files, but can't read the Openshot project files?

Exactly. If you look at the contents of an OpenShot project file, you'll see that there's no information there that the ffmpeg program could make use of. Here's one:


Sample OpenShot project data (expand to view)

{
   "channel_layout" : 3,
   "channels" : 2,
   "clips" : [
      {
         "alpha" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "anchor" : 0,
         "channel_filter" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "channel_mapping" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_height" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_width" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "display" : 0,
         "duration" : 44.5427017211914,
         "effects" : [],
         "end" : 44.5427017211914,
         "file_id" : "AE4ZZ2JMKZ",
         "gravity" : 4,
         "has_audio" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "has_video" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "id" : "E8KWIGKGDN",
         "image" : "../../../../.openshot_qt/thumbnail/AE4ZZ2JMKZ.png",
         "layer" : 3,
         "location_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "location_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "mixing" : 0,
         "perspective_c1_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c1_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c2_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c2_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c3_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c3_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c4_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c4_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "position" : 36.64,
         "reader" : {
            "acodec" : "",
            "audio_bit_rate" : 0,
            "audio_stream_index" : -1,
            "audio_timebase" : {
               "den" : 1,
               "num" : 1
            },
            "channel_layout" : 4,
            "channels" : 0,
            "display_ratio" : {
               "den" : 9,
               "num" : 16
            },
            "duration" : 44.5427017211914,
            "file_size" : "5538157",
            "fps" : {
               "den" : 445427,
               "num" : 6450000
            },
            "has_audio" : false,
            "has_single_image" : false,
            "has_video" : true,
            "height" : 1440,
            "interlaced_frame" : false,
            "metadata" : {
               "com.android.version" : "6.0.1",
               "compatible_brands" : "isommp42",
               "creation_time" : "2017-12-11T12:28:46.000000Z",
               "handler_name" : "VideoHandle",
               "language" : "eng",
               "major_brand" : "mp42",
               "minor_version" : "0"
            },
            "path" : "../../../../Videos/Edits/AvengersAcademy-GuardiansDanceoff.mp4",
            "pixel_format" : 0,
            "pixel_ratio" : {
               "den" : 1,
               "num" : 1
            },
            "sample_rate" : 0,
            "top_field_first" : true,
            "type" : "FFmpegReader",
            "vcodec" : "h264",
            "video_bit_rate" : 994662,
            "video_length" : "645",
            "video_stream_index" : 0,
            "video_timebase" : {
               "den" : 90000,
               "num" : 1
            },
            "width" : 2560
         },
         "rotation" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "scale" : 1,
         "scale_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "scale_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "shear_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "shear_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "start" : 0,
         "time" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "title" : "AvengersAcademy-GuardiansDanceoff.mp4",
         "volume" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "wave_color" : {
            "alpha" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 255
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "blue" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 255
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "green" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 123
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "red" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 0
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            }
         },
         "waveform" : false
      },
      {
         "alpha" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "anchor" : 0,
         "channel_filter" : {
            "Points" : []
         },
         "channel_mapping" : {
            "Points" : []
         },
         "crop_height" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_width" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "crop_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "display" : 0,
         "duration" : 44.5427017211914,
         "effects" : [],
         "end" : 44.5427017211914,
         "file_id" : "AE4ZZ2JMKZ",
         "gravity" : 4,
         "has_audio" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "has_video" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "id" : "V6WOPZ2VCG",
         "image" : "../../../../.openshot_qt/thumbnail/AE4ZZ2JMKZ.png",
         "layer" : 2,
         "location_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "location_y" : {
            "Points" : []
         },
         "mixing" : 0,
         "perspective_c1_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c1_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c2_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c2_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c3_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c3_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c4_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "perspective_c4_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : -1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "position" : 0,
         "reader" : {
            "acodec" : "",
            "audio_bit_rate" : 0,
            "audio_stream_index" : -1,
            "audio_timebase" : {
               "den" : 1,
               "num" : 1
            },
            "channel_layout" : 4,
            "channels" : 0,
            "display_ratio" : {
               "den" : 9,
               "num" : 16
            },
            "duration" : 44.5427017211914,
            "file_size" : "5538157",
            "fps" : {
               "den" : 445427,
               "num" : 6450000
            },
            "has_audio" : false,
            "has_single_image" : false,
            "has_video" : true,
            "height" : 1440,
            "interlaced_frame" : false,
            "metadata" : {
               "com.android.version" : "6.0.1",
               "compatible_brands" : "isommp42",
               "creation_time" : "2017-12-11T12:28:46.000000Z",
               "handler_name" : "VideoHandle",
               "language" : "eng",
               "major_brand" : "mp42",
               "minor_version" : "0"
            },
            "path" : "../../../../Videos/Edits/AvengersAcademy-GuardiansDanceoff.mp4",
            "pixel_format" : 0,
            "pixel_ratio" : {
               "den" : 1,
               "num" : 1
            },
            "sample_rate" : 0,
            "top_field_first" : true,
            "type" : "FFmpegReader",
            "vcodec" : "h264",
            "video_bit_rate" : 994662,
            "video_length" : "645",
            "video_stream_index" : 0,
            "video_timebase" : {
               "den" : 90000,
               "num" : 1
            },
            "width" : 2560
         },
         "rotation" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "scale" : 1,
         "scale_x" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0.526315789473684
                  },
                  "interpolation" : 2
               }
            ]
         },
         "scale_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0.593984962406015
                  },
                  "interpolation" : 2
               }
            ]
         },
         "shear_x" : {
            "Points" : []
         },
         "shear_y" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 0
                  },
                  "interpolation" : 2
               }
            ]
         },
         "start" : 0,
         "time" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "title" : "AvengersAcademy-GuardiansDanceoff.mp4",
         "volume" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "interpolation" : 2
               }
            ]
         },
         "wave_color" : {
            "alpha" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 255
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "blue" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 255
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "green" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 123
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            },
            "red" : {
               "Points" : [
                  {
                     "co" : {
                        "X" : 1,
                        "Y" : 0
                     },
                     "handle_left" : {
                        "X" : 0.5,
                        "Y" : 1
                     },
                     "handle_right" : {
                        "X" : 0.5,
                        "Y" : 0
                     },
                     "handle_type" : 0,
                     "interpolation" : 0
                  }
               ]
            }
         },
         "waveform" : false
      }
   ],
   "duration" : 300,
   "effects" : [
      {
         "brightness" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 1
                  },
                  "handle_left" : {
                     "X" : 0.5,
                     "Y" : 1
                  },
                  "handle_right" : {
                     "X" : 0.5,
                     "Y" : 0
                  },
                  "handle_type" : 0,
                  "interpolation" : 0
               },
               {
                  "co" : {
                     "X" : 191,
                     "Y" : -1
                  },
                  "handle_left" : {
                     "X" : 0.5,
                     "Y" : 1
                  },
                  "handle_right" : {
                     "X" : 0.5,
                     "Y" : 0
                  },
                  "handle_type" : 0,
                  "interpolation" : 0
               }
            ]
         },
         "contrast" : {
            "Points" : [
               {
                  "co" : {
                     "X" : 1,
                     "Y" : 3
                  },
                  "interpolation" : 2
               }
            ]
         },
         "end" : 7.90270172119141,
         "id" : "OKES9SC84U",
         "layer" : 3,
         "position" : 36.64,
         "reader" : {
            "acodec" : "",
            "audio_bit_rate" : 0,
            "audio_stream_index" : -1,
            "audio_timebase" : {
               "den" : 1,
               "num" : 1
            },
            "channel_layout" : 4,
            "channels" : 0,
            "display_ratio" : {
               "den" : 4,
               "num" : 5
            },
            "duration" : 86400,
            "file_size" : "1658880",
            "fps" : {
               "den" : 1,
               "num" : 30
            },
            "has_audio" : false,
            "has_single_image" : true,
            "has_video" : true,
            "height" : 576,
            "interlaced_frame" : false,
            "metadata" : {},
            "path" : "@transitions/common/fade.svg",
            "pixel_format" : -1,
            "pixel_ratio" : {
               "den" : 1,
               "num" : 1
            },
            "sample_rate" : 0,
            "top_field_first" : true,
            "type" : "QtImageReader",
            "vcodec" : "",
            "video_bit_rate" : 0,
            "video_length" : "2592000",
            "video_stream_index" : -1,
            "video_timebase" : {
               "den" : 30,
               "num" : 1
            },
            "width" : 720
         },
         "replace_image" : false,
         "start" : 0,
         "title" : "Transition",
         "type" : "Mask"
      }
   ],
   "export_path" : "",
   "files" : [
      {
         "acodec" : "",
         "audio_bit_rate" : 0,
         "audio_stream_index" : -1,
         "audio_timebase" : {
            "den" : 1,
            "num" : 1
         },
         "channel_layout" : 4,
         "channels" : 0,
         "display_ratio" : {
            "den" : 9,
            "num" : 16
         },
         "duration" : 44.5427017211914,
         "file_size" : "5538157",
         "fps" : {
            "den" : 445427,
            "num" : 6450000
         },
         "has_audio" : false,
         "has_single_image" : false,
         "has_video" : true,
         "height" : 1440,
         "id" : "AE4ZZ2JMKZ",
         "interlaced_frame" : false,
         "media_type" : "video",
         "metadata" : {
            "com.android.version" : "6.0.1",
            "compatible_brands" : "isommp42",
            "creation_time" : "2017-12-11T12:28:46.000000Z",
            "handler_name" : "VideoHandle",
            "language" : "eng",
            "major_brand" : "mp42",
            "minor_version" : "0"
         },
         "path" : "../../../../Videos/Edits/AvengersAcademy-GuardiansDanceoff.mp4",
         "pixel_format" : 0,
         "pixel_ratio" : {
            "den" : 1,
            "num" : 1
         },
         "sample_rate" : 0,
         "top_field_first" : true,
         "type" : "FFmpegReader",
         "vcodec" : "h264",
         "video_bit_rate" : 994662,
         "video_length" : "645",
         "video_stream_index" : 0,
         "video_timebase" : {
            "den" : 90000,
            "num" : 1
         },
         "width" : 2560
      },
      {
         "acodec" : "aac",
         "audio_bit_rate" : 126320,
         "audio_stream_index" : 1,
         "audio_timebase" : {
            "den" : 48000,
            "num" : 1
         },
         "channel_layout" : 3,
         "channels" : 2,
         "display_ratio" : {
            "den" : 9,
            "num" : 16
         },
         "duration" : 2.88000011444092,
         "file_size" : "1830523",
         "fps" : {
            "den" : 17267,
            "num" : 414000
         },
         "has_audio" : true,
         "has_single_image" : false,
         "has_video" : true,
         "height" : 1080,
         "id" : "J7PTFZG71Z",
         "interlaced_frame" : false,
         "media_type" : "video",
         "metadata" : {
            "compatible_brands" : "isomiso2avc1mp41",
            "encoder" : "Lavf57.71.100",
            "handler_name" : "SoundHandler",
            "language" : "eng",
            "major_brand" : "isom",
            "minor_version" : "512"
         },
         "path" : "../../../../Videos/Edits/Aquaman-crowd.mp4",
         "pixel_format" : 0,
         "pixel_ratio" : {
            "den" : 1,
            "num" : 1
         },
         "sample_rate" : 48000,
         "top_field_first" : true,
         "type" : "FFmpegReader",
         "vcodec" : "h264",
         "video_bit_rate" : 5084786,
         "video_length" : "70",
         "video_stream_index" : 0,
         "video_timebase" : {
            "den" : 24000,
            "num" : 1
         },
         "width" : 1920
      }
   ],
   "fps" : {
      "den" : 1,
      "num" : 24
   },
   "height" : 720,
   "history" : {
      "redo" : [],
      "undo" : []
   },
   "id" : "T0",
   "import_path" : "/home/ferd/Videos/Edits",
   "layers" : [
      {
         "id" : "L0",
         "label" : "",
         "lock" : false,
         "number" : 0,
         "y" : 0
      },
      {
         "id" : "L1",
         "label" : "",
         "lock" : false,
         "number" : 1,
         "y" : 0
      },
      {
         "id" : "L2",
         "label" : "",
         "lock" : false,
         "number" : 2,
         "y" : 0
      },
      {
         "id" : "L3",
         "label" : "",
         "lock" : false,
         "number" : 3,
         "y" : 0
      }
   ],
   "markers" : [],
   "playhead_position" : 0,
   "profile" : "HD 720p 24 fps",
   "progress" : [],
   "sample_rate" : 48000,
   "scale" : 14,
   "settings" : {},
   "tick_pixels" : 100,
   "version" : {
      "libopenshot" : "0.2.0",
      "openshot-qt" : "2.4.2"
   },
   "width" : 1280
}

(I removed the undo information that would otherwise add 13,000 lines to the file, but it's still 1100+ lines since JSON has a very inefficient structure when "pretty-printed".)

You can see the information supplied by the FFmpeg libraries about the media components in the "reader" dictionary on each media clip. That information was collected when the source file was passed to the library for identification and validation, so that we could get the format, codecs, frame rate, length, resolution, etc.

But there's _nothing_ there that FFmpeg could read and process directly, since ffmpeg is just a decoder and encoder for media streams, and the stream data it needs hasn't been generated yet. The JSON project file just tells libopenshot _how_ to generate that data, which it does when the Export process is started.

So if I guess it correctly, Openshot or Libopenshot uses Fmpeg, but encodes it before Ffmpeg can encode it to .mp4?

In one sense, exactly right... and in another sense, completely the opposite, actually.

When libopenshot is using libavcodec, libavformat, libavfilter, etc. to encode video, what it's passing to the encoder is actually the completely _UN-encoded_ video stream, as individual full-frame images, one by one by one by however many frames per second the output video is, times its length.

The encoder's job is to take all of those individual video frames (and the accompanying audio data), and apply all of the optimizations that allow them to be stored efficiently as a multiplexed media stream. But the contents of the actual frame images, that's all created by libopenshot. The project file data is just the recipe it will follow when it creates them.

Would I ever be able to use some kind of light weight export function for OpenShot projects?

If you can make our encoder more lightweight, that would be amazing, and we'd love to have that code contributed back to libopenshot!

But, short of _rewriting_ all of libopenshot itself, afraid not. You'd need code that can read and understand the project file data, and then perform all of the same functions libopenshot performs in assembling the raw data it sends to the encoder. The only code in existence that does all of those things, right now, is libopenshot itself.

Again, the support is appreciated, are you a developer as well on Openshot?

I've contributed code to the project, yeah. Purely as what GitHub labels a "Collaborator" — sounds vaguely subversive. @jonoomph is the the project owner / lead.

This elaborate response.. I'm feeling a bit guilty :^). Tomorrow morning I will be going through the post as it's getting late here.

I should've included a TL;DR, which would be:

The only realistic options for creating a lightweight encoder for OpenShot project files are:

  1. _Improve_ the existing libopenshot, so it's more lightweight
  2. _Rewrite_ libopenshot completely into a more lightweight form. (But that would require reimplementing all of its functionality, so that it can still do the same things. Which would be no small task. The first version has taken over 5 years just to get to its current form...)

In short,

a. OpenShot uses own format to specify in which way (order) to render the video fragments;
b. OpenShot uses Qt to render each video itself;
c. OpenShot uses FFmpeg to encode each rendered video.

OpenShot uses slow settings during video export in favor of output quality.

a. OpenShot uses own format to specify in which way (order) to render the video fragments;

Well, not _just_ ordering — also how to render each frame of the output video. The input video(s) are only partial components of each final, "mixed-down", rendered frame, potentially.

Effects may need to be applied, transforms like scaling and rotation may need to be done, compositing of still images like titles, transition masks, and etc. may need to be done... all of that is work libopenshot performs to generate the final frame image, before it's even sent to ffmpeg for encoding into the output stream.

Anyone who uses OpenShot for simple transcoding type processing — meaning, one video in, one video out, simply to change the format or encoding of that video — is, IMHO, using their tools wrong.

I know there are people who _do_ use it that way, and that's their choice, but for those sort of operations it is absolutely very, very slow. And it will never not be, because it's not being optimized for those cases. There are plenty of other good, free tools that _are_ optimized for transcoding — purpose-focused software like avidemux, HandBrake, and the like — which do a _much_ better job, much _faster_, than OpenShot does or will ever do, for basic transcoding needs.

(Not saying that's your situation or that you're one of the people using the wrong tool, @bmfb46680 ... just ranting at a cloud.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

malinga91 picture malinga91  Â·  3Comments

Yesideez picture Yesideez  Â·  3Comments

audioclown picture audioclown  Â·  3Comments

ppkakkar picture ppkakkar  Â·  3Comments

ghost picture ghost  Â·  3Comments