Openshot-qt: Custom Export Profile 20170x1080 resolution at 30 FPS

Created on 25 Jul 2019  Â·  42Comments  Â·  Source: OpenShot/openshot-qt

Question:
I'm trying to create a custom MP4 with a resolution of 20170x1080 at 29.97 FPS, when I create a custom profile and use these details, relaunch OSVE I can see the profile but when I click export I'm prompted with "Sorry, there was an error exporting your video: Could not open codec"

System Details:

  • OpenShot Version 2.4.4
  • Operating System / Distro: Windows 10

Screenshots:
The custom profile on the left and the source file details on the right.
https://i.imgur.com/QLrumEd.png

Thank you in advance

help wanted question

All 42 comments

@Jarli01
I'll be honest, I don't know that anyone's ever tried to use dimensions even _close_ to those with OpenShot. I hope you have a disturbing amount of RAM in your system!

My first question would be whether FFmpeg can handle those dimensions, just internally. It might be worth installing whatever native Windows build of FFmpeg is available and trying to play the source file with ffplay (their reference player), to see if it balks as well.

Also, if the pixel aspect is 1:1, then I'd think you'd need to set your profile's display aspect ratio to something that matches the video dimensions, e.g.

display_aspect_num=18676
display_aspect_den=1000

But I'd be pretty surprised if that alone was preventing it from working.

So I was able to convert to WEBM and the aspect ratio came out at 9999x1080, obviously way smaller than what this person is looking for. But it does look good on my tiny monitor compared to what this wants to be put on.

Going to do some more testing

Here's the output from ffplay

ffplay.exe HALP.mov
ffplay version N-94387-g923d5c489f Copyright (c) 2003-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190716
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HALP.mov':q=    0B f=0/0
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2019-07-25T15:54:08.000000Z
  Duration: 00:00:15.05, start: 0.000000, bitrate: 266042 kb/s
    Stream #0:0(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, bt709, progressive), 20170x1080, 265485 kb/s, SAR 1:1 DAR 2017:108, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
    Metadata:
      creation_time   : 2019-07-25T15:54:08.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422
      timecode        : 00:00:00;00
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-07-25T15:54:08.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00;00
  39.21 M-V:  0.057 fd= 183 aq=    0KB vq=    0KB sq=    0B f=0/0

Also confirmed that the pixel ratio is 1:1

ffmpeg reports the display aspect as DAR 2017:108, so I'd suggest matching that in your custom profile:

display_aspect_num=2017
display_aspect_den=108

You should also set up the project with that profile selected (File > Choose Profile), not just choose it on export, since the aspect ratio is so wildly different than all the other profiles.

When you select the export codec, what Target are you using? If it's any of the hardware-accelerated options — "MP4 (h.264 )" — the video's going to be too big for the hardware buffers (on any card I've ever heard of), so that could be causing the "Could not open codec" error. Try selecting just "MP4 (h.264)" to use the software encoder.

I was using MP4 h.264 and it errors out. Even with the recommendations it errors out with the profile set.

Not sure if I'm actually going to be able to render this out with those dimensions at all.

It seems like the profile wide has a maximum limit of 9999 and that can't be exceeded. Do you know if this is true?

launch_M2KiEEqmrv

Yeah, I'm not sure what the problem might be, sorry. That's _waay_ beyond the typical OpenShot job — I don't know for sure it DOESN'T work, but I also wouldn't want to make any promises that it DOES.

Perhaps @jonoomph or someone else will have more information on working with super-high-res output dimensions like these, I'll flag the issue for attention.

It seems like the profile wide has a maximum limit of 9999 and that can't be exceeded.

That, I can check easily enough...

Yeah I mean, maybe if this work if I can simply override the wide to meet what I need beyond that 9999 setting and give the person a webm which does export and looks good.

Yeah, it appears that the max for that field is indeed 9999, I guess we never planned on anyone exceeding it!

Let's see... in your C:\Program Files\OpenShot Video Editor\ directory, is there a windows\ui\export.ui file?

There is

OK, if you quit OpenShot, then open that file in an editor that can deal with Unix line endings (WordPad yes, Notepad no), you can search for 9999 and change it to 99999 in two places (might as well raise the max height, too...). Then save the file back and launch OpenShot again.

This is what I see at line 411

           <property name="maximum">
            <number>99999999</number>

and 445

            <property name="maximum">
            <number>99999999</number>

Nope, those are the frame number fields. You want txtWidth and txtHeight,

              <widget class="QSpinBox" name="txtWidth">
               <property name="sizePolicy">
                <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               </property>
               <property name="minimum">
                <number>2</number>
               </property>
               <property name="maximum">
                <number>9999</number>
               </property>
              </widget>

(is one of them)

Found it, updated in 8 places actually.

(I can't give you line numbers because I know they've changed in my copy of the file, sorry.)

:+1: Can't hurt!

ha. . . can't open the codec. . . after making those changes.

As I was going to say, I'd try the MP4 export again too. It could be that the failure was simply due to 9999 not being a multiple of 2, which MP4 is picky about.

Heh. Well, damn.

I think it is actually working, had to close and confirm the changes were set.

Now just of recoup all 1024GB of RAM for this. . .

Well, that is definitely a disturbing amount of RAM!

So here's the output from ffplay. . . can't play it myself . . . (I was joking about 1TB of ram).

ffplay.exe "converted.mp4"
ffplay version N-94387-g923d5c489f Copyright (c) 2003-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190716
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'converted.mp4': 0B f=0/0
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:15.06, start: 0.033000, bitrate: 7762 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 20170x1080, 7759 kb/s, 30.04 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Switch subtitle stream from #-1 to #-1 vq=  931KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=  940KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq= 1352KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq= 1088KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0
Switch subtitle stream from #-1 to #-1 vq=    0KB sq=    0B f=0/0
  15.09 A-V:-122.248 fd=  26 aq=    0KB vq=    0KB sq=    0B f=0/0

That's the output of OpenShot's encode? Well... it's the right dimensions, at least! Good sign.

I think what I have will work, thank you for the quick assistance.

@Jarli01 What was the outcome, did the export actually work once we raised the max width/height values? (As MP4? As WebM?)

If so, and > 9999px output dimensions are usable, I'll submit a PR to increase the max to 50000 or something. (Probably not 99999 since odd dimensions break MP4, so 9999 was always a terrible choice really.)

So far the highest resolution video I could get to play with was 9999x1080 as webm vp9.

I believe it would work to bump this up to higher dimensions but I personally was unable to produce a workable codec.

Likely I simply need to know what the specifications are to make it work more fluidly.

Here is the working file ffprobe details

ffprobe.exe "sample-20k.webm"
ffprobe version N-94387-g923d5c489f Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190716
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'sample-20k.webm':
  Metadata:
    ENCODER         : Lavf57.83.100
  Duration: 00:00:15.09, start: 0.033000, bitrate: 4890 kb/s
    Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 9999x1080, lossless, SAR 1:1 DAR 1111:120, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      DURATION        : 00:00:15.082000000
    Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:00:15.094000000

It would also only play in Windows Media player / chrome and not in VLC. So I'm not sure how realistic these resolutions are going to be. I'd be happy to do more testing though.

Hmmm, interesting.

One experiment I would be curious about, since you have ffmpeg installed: Is FFmpeg _itself_ able to produce a 20170x1080 video? (We know it can read and play it, but how about _encoding_ to those dimensions?

The easiest way to test that would be, starting from your source file (MOV):

# Convert to 20170x1080 WEBM
ffmpeg -i HALP.mov HALP.webm
# If that works, convert WEBM to 20170x1080 MP4
ffmpeg -i HALP.webm HALP.mp4
# (Or, if it doesn't work, try converting straight from the MOV.
# But they're practically the same format so the vp9 file is a better test conversion source.)

When I tried it (converting from a non-20170x1080 source file), the WEBM attempt hit me with this:

[libvpx-vp9 @ 0x556defc5fcc0] Error encoding frame: Memory allocation error
[libvpx-vp9 @ 0x556defc5fcc0]   Additional information: Failed to allocate lag buffers
Video encoding failed

But the MP4 attempt _ostensibly_ worked. (I have no way to play the resulting file, so it's at best an inconclusive test.)

The other thing is, Apple ProRes is actually its _own_ codec, and it's supported by FFmpeg for output as well as input. MOV is required as the output container (even MP4 won't work). With dimensions like that, ProRes encoding may be a requirement. You'd use that with FFmpeg like so:

# Encode to Apple ProRes in MOV container
ffmpeg -i HALP.mp4 -vcodec prores ProResOut.mov

If that worked, it'd theoretically be possible to export the same format in OpenShot by manually entering "mov" for Video Format and "prores" for Video Codec, in the Advanced section of the Export dialog.

So the initial conversion from the MOV to the webm completes (is unplayable on anything I have atm) but does complete. The conversion of the webm to the MP4 fails with the same error.

I'm going to test to see if the webm at least plays on a mac though.

Doesn't play on mac either, gotta see if there is a way to allocate more ram to the conversion process.

The failed conversion - due to the allocation size

ffmpeg.exe -i HALP.mov HALP-20k-test1.mp4
ffmpeg version N-94387-g923d5c489f Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190716
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HALP.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2019-07-25T15:54:08.000000Z
  Duration: 00:00:15.05, start: 0.000000, bitrate: 266042 kb/s
    Stream #0:0(eng): Video: prores (Standard) (apcn / 0x6E637061), yuv422p10le(tv, bt709, progressive), 20170x1080, 265485 kb/s, SAR 1:1 DAR 2017:108, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
    Metadata:
      creation_time   : 2019-07-25T15:54:08.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422
      timecode        : 00:00:00;00
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-07-25T15:54:08.000000Z
      handler_name    : Time Code Media Handler
      timecode        : 00:00:00;00
Stream mapping:
  Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000001de6808a2c0] using SAR=1/1
[libx264 @ 000001de6808a2c0] frame MB size (1261x68) > level limit (139264)
[libx264 @ 000001de6808a2c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001de6808a2c0] profile High 4:2:2, level 6.2, 4:2:2, 10-bit
[libx264 @ 000001de6808a2c0] 264 - core 157 r2970 5493be8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: 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=12 lookahead_threads=2 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'xerox-20k-test1.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf58.30.100
    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv422p10le, 20170x1080 [SAR 1:1 DAR 2017:108], q=-1--1, 0.03 fps, 30k tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2019-07-25T15:54:08.000000Z
      handler_name    : Apple Video Media Handler
      timecode        : 00:00:00;00
      encoder         : Lavc58.55.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
x264 [error]: malloc of size 153650816 failede=00:00:00.00 bitrate=N/A speed=   0x

Ah. So, it turns out H.264's High Profile has a max resolution of only like 4096x2048 — sounds like x264 is very much a dead end, for this. (The max res is buried in that unreadable reference document _somewhere_, trust me.)

WEBM _should_ work, though, as the max dimensions are 16384x16384 for VP8 and 65536x65536 for VP9.

But if H.264 is a no-go, encoding back to ProRes may be your best bet.

Well VP9 would work at those dimensions for my need, the question comes in do I have the horsepower to get it to complete.

The other thing that makes me nervous is, 20170 is a multiple only of 2, but not 4 or 8. A lot of encoders like their video dimensions to be even multiples of some block size they work in. (Even 16 isn't unheard of, which is why some video is encoded with a height of 1088 instead of 1080.)

You might try exporting at a width of either 20176 or 20168, so you're working in multiples of 8 in both dimensions.

That would mean I have to adjust the codec, correct?

Also since VP9 uses 16-bit would a multiple of 16 be better for both dimensions?

To export in ProRes from OpenShot you'd go into the Advanced tab of the Export dialog, Video Settings page, and set:

Video Format: mov
Video Codec: prores

--

Also since VP9 uses 16-bit would a multiple of 16 be better for both dimensions?

As best I understand it, that's not related, no, that's just the length of the data field used to store the dimensions. The critical factor is the size of the blocks that (some) encoders divide the video up into, during processing.

...That being said, it can't _hurt_ anything to choose a width that's a multiple of 16, too.

The source file is already an MOV in prores, and that's the issue. The goal is to get the file to something a bit more agnostic besides "Apple only" format.

So the VP9 option, seems like the best option but I can't get the output to play on anything I have here.

Ah, I see.

If your _only_ goal is to convert the file from one format to another (IOW, you're not editing the content along the way), TBH OpenShot probably isn't the best tool for that job.

Anything you could do in OpenShot, by definition you could also do using ffmpeg, and probably more efficiently and quickly. (Modulo the cryptic command line interface.) You also have the advantage that, because of the more direct interface to the encoder, there's better visibility if you run into any constraints or problems.

(Like my failed attempt to export ProRes into an MP4 container. Attempting the same in OpenShot would've also failed in the same way, but I'm not sure it would've surfaced the _reason_ quite so clearly as this ffmpeg error message:)

[mp4 @ 0x560e31611ac0] Could not find tag for codec prores in stream #0, codec not currently
 supported in container
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sefran007 picture Sefran007  Â·  3Comments

audioclown picture audioclown  Â·  3Comments

Obed9 picture Obed9  Â·  3Comments

carlosnewmusic picture carlosnewmusic  Â·  3Comments

malinga91 picture malinga91  Â·  3Comments