How do I use dual pass with vp9/webm?

I have used dual pass in premiere before, but in shotcut the output always ends up sound only, no video, and at a very small video size.

I even tried with the default preset for webm, and vp9-webm but same result every time. Not sure what I’m doing wrong or if it’s a bug with shotcut. I tried reinstalling to have fresh settings so I try it with the default out of the box settings with same results.

Here are pastebins with log and XML output from the two jobs using dual pass:

Job 1: https://pastebin.com/raw/SsnN5RrZ
Job 2: https://pastebin.com/raw/qW3E6Tup

i just did two exports with webm-vp9. Used default settings. A dual pass export and a regular export. Both worked fine. Audio and video played. The dual pass video had a sightly smaller file size than the single pass.

Here’s the video.

https://streamable.com/prap9

as far as i know vp9 uses dual pass by default

Could you maybe provide logs if you don’t mind? I would want to compare with mine to see if there’s any difference there. Also what windows are you on? Would that be significant?

I’m on W10 x64

Neat, you’re also a Norwegian.

Anyway, in shotcut it does not. With all default settings dual pass is not activated, cleaned out all settings possible, registry clean etc, fresh install: Dual pass is not enabled.

VP9 as a codec does not use dual pass as default either, you have to send arguements to the encoder for it to use dual pass.

I get 2 logs with dual pass. I did this encode a few minutes ago and all went well. Audio and video play.

https://drive.google.com/open?id=1Pm4UjU0EEJ6Q7_hZldZBFNswq0rKWAVn

https://drive.google.com/open?id=1zprnsxfyDxkPKXCPyUBUzZe0KhemgBUT

Windows 10 pro x64

Hmm I notice you’re not getting any error messages on the second pass, as I do for some reason.

[libvpx-vp9 @ 000000000072d360] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 000000000072d360] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[libvpx-vp9 @ 000000000072d360] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 000000000072d360] Additional information: rc_twopass_stats_in.sz indicates truncated packet.
[libopus @ 00000000064ea2e0] Value 16666,000000 for parameter ‘frame_duration’ out of range [2,5 - 60]

Yours is

[libvpx-vp9 @ 000000000c75eb00] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 000000000c75eb00] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[libopus @ 0000000007dbf540] Value 33333.000000 for parameter ‘frame_duration’ out of range [2.5 - 60]

I have no clue why this is happening.

I used the default settings for the export. Did not change anything except checked the dual pass option.

I noticed that you are using an OBS studio video D:/Misc/OBS recordings/ReplayBuffer 2018-03-25 22-46-25.mp4 in your project. Maybe it’s the way the video or audio was created that’s causing the error.

The only thing I can think of is try using a different video clip to see if you get a different result. Maybe one of the developers might look at this thread and be able to shed light on what might be happening.

A while back I did a test and exported a video clip using all the Shotcut presets with default values. As of Shotcut 18.03.06 all the exports work except for stills/DPX.

hei neko, hmm did you guys try my webm preset?

oh meybe it was vpxenc that defaults to 2-pass

Good suggestion trying other videos, I hadn’t thought of that. But it didn’t help much, I tried out 6 different videos from different sources in different formats and getting the same issue as always.

Tried your preset, getting same issue.

Would be nice if a dev could take a look, this part from the logs is what I can see is where the issue starts.

[libvpx-vp9 @ 000000000072d360] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[libvpx-vp9 @ 000000000072d360] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 000000000072d360] Additional information: rc_twopass_stats_in.sz indicates truncated packet.

I really don’t get it, because the parameters it’s sending are the exact same parameters it sends for the first pass or other outputs when I don’t do dual pass.

Here’s a log output from a single pass output.

[libvpx-vp9 @ 000000000072dd00] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 000000000072dd00] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[h264 @ 000000000072a820] Reinit context to 1280x720, pix_fmt: yuv420p
[libopus @ 000000000661ba00] Value 16666,000000 for parameter ‘frame_duration’ out of range [2,5 - 60]
[h264 @ 000000000072c500] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 000000000f2d90c0] Reinit context to 1280x720, pix_fmt: yuv420p
[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2
[producer avformat-novalidate] D:/Misc/OBS recordings/ReplayBuffer 2018-03-31 16-17-48.mp4
checking VFR: pkt.duration 256
[h264 @ 000000000f2d9a60] Reinit context to 1280x720, pix_fmt: yuv420p
[webm @ 0000000006762340] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[webm @ 0000000006762340] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Automatically inserted bitstream filter ‘vp9_superframe’; args=‘’
Current Frame: 228, percentage: 94
Current Frame: 229, percentage: 95
Current Frame: 230, percentage: 95
Current Frame: 232, percentage: 96
Current Frame: 233, percentage: 96
Current Frame: 234, percentage: 97
Current Frame: 235, percentage: 97
Current Frame: 236, percentage: 97
Current Frame: 238, percentage: 98
Current Frame: 239, percentage: 99
Current Frame: 240, percentage: 99
Completed successfully in 00:00:14

Can’t think of anything else. All my exports work. Very odd that all yours are failing.:confused:

Try uploading one of the video clips that fail. I want to see if it fails here as well.

IIRC, OBS Studio uses VFR, variable frame rate, which Shotcut doesn’t like. My 2 cents.

-=Ken=-

It doesn’t. Shotcut makes sure to inform me when there’s a video with vfr, but it doesn’t with OBS recordings, which I know for a fact does not record in VFR. Not that it matter, because I tried a bunch of other videos too not from OBS, including a video recorded with my phone, 2 different videos downloaded from youtube, and different videos here and there.

OBS is obviously not the issue here and neither is VFR.

Can do.

Source: https://drive.google.com/open?id=1vNvlp0uXpxFF6YpcLJ5CAjJHG2F9F68x
Dual pass encoded output (no video): https://drive.google.com/open?id=18Boo2isLHfBoeHXpBlQUYyubxXFX6KOh

Log from second pass job

[libvpx-vp9 @ 000000000496c500] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 000000000496c500] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[libvpx-vp9 @ 000000000496c500] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 000000000496c500] Additional information: rc_twopass_stats_in.sz indicates truncated packet.
[libopus @ 000000000664af60] Value 16666,000000 for parameter ‘frame_duration’ out of range [2,5 - 60]
[h264 @ 000000000496ace0] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 000000000496a820] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 000000000f7bcbc0] Reinit context to 1280x720, pix_fmt: yuv420p
[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2
[producer avformat-novalidate] D:/Misc/OBS recordings/ReplayBuffer 2018-04-01 18-07-02.mp4
checking VFR: pkt.duration 256
[h264 @ 000000000f7bc700] Reinit context to 1280x720, pix_fmt: yuv420p
[webm @ 0000000006792340] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[webm @ 0000000006792340] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Current Frame: 395, percentage: 83
Current Frame: 401, percentage: 84
Current Frame: 407, percentage: 86
Current Frame: 414, percentage: 87
Current Frame: 420, percentage: 88
Current Frame: 426, percentage: 90
Current Frame: 433, percentage: 91
Current Frame: 439, percentage: 93
Current Frame: 445, percentage: 94
Current Frame: 452, percentage: 95
Current Frame: 458, percentage: 97
Current Frame: 464, percentage: 98
Current Frame: 470, percentage: 99
Completed successfully in 00:00:03

New users can only post two links per post. That’s helpful.

Single pass encoded output (works): https://drive.google.com/open?id=1Kl8uVKdY4bR6siX3RwpTJ81op9mB8rpm

Got you r video and did a 2 pass encode. It worked fine.
The video is here.

https://streamable.com/hjryq

Here’s the actual WebM video. Streamable might convert it

https://drive.google.com/open?id=19PKa6XkeDAxyBr2SKnUnjW6rRZniyxTL

And the logs.

[libvpx-vp9 @ 0000000007f61d20] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 0000000007f61d20] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[h264 @ 0000000007f62200] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0000000007f64d40] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0000000007f643a0] Reinit context to 1280x720, pix_fmt: yuv420p
[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2
[producer avformat-novalidate] H:/Shotcut/Test/ReplayBuffer 2018-04-01 18-07-02.mp4
checking VFR: pkt.duration 256
[h264 @ 0000000014268680] Reinit context to 1280x720, pix_fmt: yuv420p
[webm @ 0000000007b968c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Current Frame: 460, percentage: 97
Current Frame: 462, percentage: 97
Current Frame: 463, percentage: 98
Current Frame: 465, percentage: 98
Current Frame: 466, percentage: 98
Current Frame: 468, percentage: 99
Current Frame: 469, percentage: 99
Current Frame: 471, percentage: 99

Completed successfully in 00:00:13

[libvpx-vp9 @ 0000000008433480] v1.7.0-134-ge0b88b5
[libvpx-vp9 @ 0000000008433480] --prefix=/root/shotcut/shotcut/Shotcut --enable-vp8 --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=x86_64-win64-gcc
[libopus @ 000000000829ee60] Value 16666.000000 for parameter ‘frame_duration’ out of range [2.5 - 60]
[h264 @ 00000000084347c0] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0000000008432140] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 00000000148745a0] Reinit context to 1280x720, pix_fmt: yuv420p
[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2
[producer avformat-novalidate] H:/Shotcut/Test/ReplayBuffer 2018-04-01 18-07-02.mp4
checking VFR: pkt.duration 256
[h264 @ 0000000014873c00] Reinit context to 1280x720, pix_fmt: yuv420p
[webm @ 00000000080668c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[webm @ 00000000080668c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Automatically inserted bitstream filter ‘vp9_superframe’; args=’'
Current Frame: 459, percentage: 97
Current Frame: 460, percentage: 97
Current Frame: 461, percentage: 97
Current Frame: 463, percentage: 98
Current Frame: 464, percentage: 98
Current Frame: 465, percentage: 98
Current Frame: 466, percentage: 98
Current Frame: 467, percentage: 98
Current Frame: 469, percentage: 99
Current Frame: 470, percentage: 99
Current Frame: 471, percentage: 99

Completed successfully in 00:00:37

I have no idea why it works here and not for you. Maybe one of the developers might take a look.

neko what shotcut version are you on?

Yeah it seems it happens on my computer specifically, and I don’t know why. I’m pretty sure these lines are key:

[libvpx-vp9 @ 000000000496c500] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 000000000496c500] Additional information: rc_twopass_stats_in.sz indicates truncated packet.

Any suggestions to how I can have a dev take a look? Was hoping that might happen by making this thread.

I think the devs might have looked at this thread and are as confused as we are about why it works for me and not you.

You could try and PM Brian or Dan.