Striped video (encoding error) in exported file

I assume that it’s either a bug of a misconfiguration of the exporting of a video.
The problem I’m facing is following:

  • I uploaded several videos to Google Photos
  • single one of them was in the horisontal (portrait) mode, so in the video I have to either soom/crop/resize or add black zones etc. I decided to go with black zones
  • all videos have miltiplication of Speed (in Properties) same for all.
  • all videos have mute and stabilize filters
  • I added a soundtrack over it and cut it to the same end as video
  • then export video… where I set parameters to following:
movflags=+faststart
preset=fast
pix_fmt=nv12
f=mp4
acodec=aac
channels=2
ar=48000
ab=384k
vcodec=h264_videotoolbox
vb=12M
g=15
bf=3
width=720
height=1280
aspect=0.5625
progressive=1
top_field_first=2
deinterlace_method=yadif
rescale=bilinear
threads=3

and in result I get the following picture with actually streaming video (the picture changes) and audio is correct (not distorted), but the encoding seems incorrect - the lines of the video are like shifted in position by X axis line-by-line.

Here’s the fprobe of one of the “portrait” videos:

> # ffprobe output
> 
> [streams.stream.0]
> index=0
> codec_name=h264
> codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
> profile=High
> codec_type=video
> codec_time_base=1/60
> codec_tag_string=avc1
> codec_tag=0x31637661
> width=720
> height=1280
> coded_width=720
> coded_height=1280
> has_b_frames=0
> sample_aspect_ratio=1:1
> display_aspect_ratio=9:16
> pix_fmt=yuv420p
> level=31
> color_range=tv
> color_space=bt470bg
> color_transfer=smpte170m
> color_primaries=bt470bg
> chroma_location=left
> field_order=unknown
> timecode=N/A
> refs=1
> is_avc=true
> nal_length_size=4
> id=N/A
> r_frame_rate=30/1
> avg_frame_rate=30/1
> time_base=1/15360
> start_pts=0
> start_time=0:00:00.000000
> duration_ts=391168
> duration=0:00:25.466667
> bit_rate=666.690000 Kbit/s
> max_bit_rate=N/A
> bits_per_raw_sample=8
> nb_frames=764
> nb_read_frames=N/A
> nb_read_packets=N/A
> 
> [streams.stream.0.disposition]
> default=1
> dub=0
> original=0
> comment=0
> lyrics=0
> karaoke=0
> forced=0
> hearing_impaired=0
> visual_impaired=0
> clean_effects=0
> attached_pic=0
> timed_thumbnails=0
> 
> [streams.stream.0.tags]
> creation_time=2019-05-09T16:54:57.000000Z
> language=und
> handler_name=ISO Media file produced by Google Inc. Created on: 05/09/2019.
> 
> [streams.stream.1]
> index=1
> codec_name=aac
> codec_long_name=AAC (Advanced Audio Coding)
> profile=LC
> codec_type=audio
> codec_time_base=1/44100
> codec_tag_string=mp4a
> codec_tag=0x6134706d
> sample_fmt=fltp
> sample_rate=44.100000 KHz
> channels=1
> channel_layout=mono
> bits_per_sample=0
> id=N/A
> r_frame_rate=0/0
> avg_frame_rate=0/0
> time_base=1/44100
> start_pts=0
> start_time=0:00:00.000000
> duration_ts=1187840
> duration=0:00:26.935147
> bit_rate=95.999000 Kbit/s
> max_bit_rate=N/A
> bits_per_raw_sample=N/A
> nb_frames=1160
> nb_read_frames=N/A
> nb_read_packets=N/A
> 
> [streams.stream.1.disposition]
> default=1
> dub=0
> original=0
> comment=0
> lyrics=0
> karaoke=0
> forced=0
> hearing_impaired=0
> visual_impaired=0
> clean_effects=0
> attached_pic=0
> timed_thumbnails=0
> 
> [streams.stream.1.tags]
> creation_time=2019-05-09T16:54:57.000000Z
> language=eng
> handler_name=ISO Media file produced by Google Inc. Created on: 05/09/2019.
> 
> [format]
> filename=......mp4
> nb_streams=2
> nb_programs=0
> format_name=mov,mp4,m4a,3gp,3g2,mj2
> format_long_name=QuickTime / MOV
> start_time=0:00:00.000000
> duration=0:00:26.935000
> size=2.341373 Mibyte
> bit_rate=729.194000 Kbit/s
> probe_score=100
> 
> [format.tags]
> major_brand=mp42
> minor_version=0
> compatible_brands=isommp42
> creation_time=2019-05-09T08:19:30.000000Z
> encoder=Google
> location=+52.4680+013.3912/
> Completed successfully in 00:00:00

And here’s the fprobe of the “landscape” video:

# ffprobe output

[streams.stream.0]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=125/7392
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=31
color_range=tv
color_space=bt470bg
color_transfer=smpte170m
color_primaries=bt470bg
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=3696/125
avg_frame_rate=3696/125
time_base=1/14784
start_pts=0
start_time=0:00:00.000000
duration_ts=1528000
duration=0:01:43.354978
bit_rate=881.312000 Kbit/s
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=3056
nb_read_frames=N/A
nb_read_packets=N/A

[streams.stream.0.disposition]
default=1
dub=0
original=0
comment=0
lyrics=0
karaoke=0
forced=0
hearing_impaired=0
visual_impaired=0
clean_effects=0
attached_pic=0
timed_thumbnails=0

[streams.stream.0.tags]
creation_time=2019-05-09T16:57:35.000000Z
language=und
handler_name=ISO Media file produced by Google Inc. Created on: 05/09/2019.

[streams.stream.1]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/44100
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44.100000 KHz
channels=1
channel_layout=mono
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0:00:00.000000
duration_ts=4627456
duration=0:01:44.930975
bit_rate=95.999000 Kbit/s
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=4519
nb_read_frames=N/A
nb_read_packets=N/A

[streams.stream.1.disposition]
default=1
dub=0
original=0
comment=0
lyrics=0
karaoke=0
forced=0
hearing_impaired=0
visual_impaired=0
clean_effects=0
attached_pic=0
timed_thumbnails=0

[streams.stream.1.tags]
creation_time=2019-05-09T16:57:35.000000Z
language=eng
handler_name=ISO Media file produced by Google Inc. Created on: 05/09/2019.

[format]
filename=.........mp4
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0:00:00.000000
duration=0:01:44.931000
size=12.091850 Mibyte
bit_rate=966.671000 Kbit/s
probe_score=100

[format.tags]
major_brand=mp42
minor_version=0
compatible_brands=isommp42
creation_time=2019-05-09T08:22:25.000000Z
encoder=Google
location=+52.4681+013.3910/
Completed successfully in 00:00:00

What am I doing wrong ?

Are you using a vertical Video Mode in Settings or New Project or trying to change it to be vertical in Export > Advanced > Video? It is better to use a vertical mode and not try to change it in export. Other than that, I think people have reported this problem with certain values use in the Crop filter, and you should take a look at that.

Thanks for suggestion, but I can’t find the Video Mode though… The tab “video” of “advanced” config in the video export dialog, there’s no Video Mode like “vertical” or “horisontal” either. In the File > Video Export menu dialog I see the following:

05

I can see only Aspect ratio, but it doesn’t help either if I switch numbers X <> Y axis. Can it be related to codec configuration?
I’ve read that GOP should be the half of Frames/sec ratio, is that correct? I’ve also tested with another codec: libx264 instead of h264_videotoolbox, but problem persists. Rate control is set to Average bitrate, B-frames to 3. Codec threads on 0=auto.

I am guessing that the actual problem is indeed somewhere on the surface - there’s a configuration which I don’t know yet impacts on the result.

TL;DR
In fresh project first of all I added the “horisontal” video, then added all other “vertical” which solved the problem. But still don’t understand why.


So, as I found out, this is indeed the problem of automatic configuration/detection of the first imported video accordingly on the whole project. Any later on added videos would be fitting into given frame. Unfortunately I didn’t find how exactly these settings are configured at first time, so I would really appreciate if you know and can comment on this. Luckily I had a short video which was quickly re-compiled, but misunderstanding is still there.

In Settings in main menu or New Project view when nothing is loaded (shotcut is first started, in the center of the main window).

You showed me a screenshot of the Advanced mode of the Export panel. I recommend that you do not try to change settings in here until you become more familiar with Shotcut.

Read the screen when Shotcut first starts. It says both “Video mode” and what happens when you choose Automatic.

Indeed, thanks a lot :slight_smile: That explanation is exactly what I discovered. I’ve been using Automatic in all cases, so it was taking the first video as example. But still, it doesn’t seem clear for me from technical side why first adding landscape, then portrait videos produces expected result while the opposite way - first portrait, second landscape - produces such encoding issue.

This topic was automatically closed after 90 days. New replies are no longer allowed.