Open angelsen opened 1 year ago
Hello @Angelsen. Sorry to see that you are having an issue with Openshot. Please provide some more details for better troubleshooting:
If in step 2 the Manjaro File Manager and Exiftool duration values do not match then there is something about Exiftool and the way it calculates the duration.
If the native Manjaro File Manager and Openshot agree on the duration (this is what I am seeing in Ubuntu 22.10) then I would think that there is no issue.
If you have other details to share to further help troubleshooting that would be great.
Hello @Colorjet3, thank you for your response and the helpful suggestions.
ExifTool, as you mentioned, is a software program that can read, write, and edit metadata in various file types. It's a very versatile tool, supporting numerous metadata formats including EXIF, GPS, IPTC, XMP, and many others, and is also capable of reading metadata from a wide range of digital cameras. This tool can be very useful in situations where you want to extract or manipulate the metadata of your files.
As for the duration of the .webm file, yes, the values provided by ExifTool and the Manjaro File Manager do match.
1) When I check the duration of the .webm file using the native Manjaro File Manager, it matches the information given by the Exiftool. So, I don't think there is a calculation issue with Exiftool.
2) In Openshot, when I right click on the clip on the Track, select Properties, and check the Duration attribute, it doesn't match the duration given by the Manjaro File Manager and Exiftool. This duration discrepancy only happens with my recent screen recordings that are encoded with VP9. My older recordings, which are encoded with VP8, are imported with the correct length in Openshot.
3) Given that the native Manjaro File Manager, Exiftool and Openshot all agree on the duration of my VP8 recordings, I'm starting to think that the issue might be related to the VP9 encoding of my recent recordings.
Any advice on what I could do next would be appreciated.
I had the same issue when trying to edit a webm screencast from ubuntu 22.04.2lts' "print screen", whilst trying to describe another issue. The 30 second ish video played in the default player correctly but would only display the first 10 seconds in openshot.
Thank you @Angelsen for the information. I am going to need to escalate this to the lead developer as I am not sure how to resolve this myself.
Hello @Angelsen I see that this hasn't been addressed by the technical team. Please try converting you .webm file using something like Handbrake. You can convert it back to .webm again or to .mp4. Import this new file into Openshot and see if that looks/works better.
I encountered this issue today. All the webm files are up to 10s shorter than the actual length. I have been using OpenShot for quite sometime, this is the only shortcoming that I have found on OpenShot. I hope this issue is resolved soon.
Hello @Keram-Yasin. There is currently no ETA on the fix. However, you should be able to convert your file to a .mp4 using something like VLC, Handbrake, or Shutter Encoder. Shutter Encoder has a "bulk convert" option that will simplify the conversion process. This should fix the issue of missing footage for now.
Hi @Colorjet3 , Yeah that was my solution for this issue. I found WinX Video Converter particularly useful to bypass the issue on OpenShot.
Same for me, 44 seconds VP8 webm shows as 22 seconds clip in openshot 3.1.1 This should be trivial to reproduce, just record a Gnome screencast to obtain a sample .webm.
I had the same experience from a screencast taken using Ubuntu's print-screen functionality (Ubuntu 22.04.3 LTS). VLC and Firefox would play the webm correctly. Openshot only displayed the first 10 seconds or so. Converting it to an mp4 using ffmpeg solved the problem.
I'm having the same issue. In my case, the video is a screen recording by "print screen" on Ubuntu 22.04. The video is in webm format and has duration 69.03 seconds. After imported to OpenShot, the duration becomes 15.4 seconds.
Environment:
I'm pretty sure the correct duration is 69.03 seconds by:
ffprobe
to inspectThe result of ffprobe
is:
$ ffprobe -v quiet -print_format json -show_format battle1.webm
{
"format": {
"filename": "battle1.webm",
"nb_streams": 1,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "0.000000",
"duration": "69.031561",
"size": "13031123",
"bit_rate": "1510164",
"probe_score": 100,
"tags": {
"encoder": "GStreamer matroskamux version 1.20.3",
"creation_time": "2024-07-02T22:52:25.941734Z"
}
}
}
After digging around, I reckon the issue lies in how libopenshot recalculating duration to handle missing frames. The relavent code is:
float avg_fps = 30.0;
if (starting_frames_detected > 0 && fps_index > 0) {
avg_fps = float(starting_frames_detected) / std::min(fps_index, max_fps_index);
}
// Verify average FPS is a reasonable value
if (avg_fps < 8.0) {
// Invalid FPS assumed, so switching to a sane default FPS instead
avg_fps = 30.0;
}
// Update FPS (truncate average FPS to Integer)
info.fps = Fraction(int(avg_fps), 1);
// Update Duration and Length
if (all_frames_detected > 0) {
// Use all video frames detected to calculate # of frames
info.video_length = all_frames_detected;
info.duration = all_frames_detected / avg_fps;
} else {
// Use previous duration to calculate # of frames
info.video_length = info.duration * avg_fps;
}
Before this part, info.duration
has the correct value of 69.03s which is read from the video header. Value of variables are:
So avg_fps = (float)4 / min(69, 3) = 4.0 / 3 = 1.3333
, it is then reset to 30.0 since it's less than 8.0(the assumption for the threshold of bad FPS). After that, info.duration
is set to 462 / 30.0 = 15.4
which is the value seen in File Properties in OpenShot.
The code gets the correct number of frames 462 which can be verified by:
$ ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames battle1.webm
[STREAM]
nb_read_frames=463
[/STREAM]
(I don't know why there is a difference of 1, though it doesn't affect the analysis.)
It seems that libopenshot
uses inappropriate assumption for average FPS(frame per second) when processing webm files, particularly screen recordings which tend to have a very low FPS when nothing moves a lot.
Title: Imported WebM Video File Shows Incorrect Duration
Description:
I'm experiencing an issue with OpenShot (version 3.1.1) on my Linux platform (Manjaro 6.1.26-1). When I import a .webm video file, the duration is reported incorrectly in OpenShot. The actual duration of the video (as shown using exiftool) is 3 minutes and 14 seconds, but OpenShot is not displaying this correct duration.
Here are the details of the video file using exiftool:
file properties json from within openshot:
Here are some relevant lines from the openshot-qt.log:
Steps to reproduce:
Expected behavior:
The duration of the video file should match the duration reported by exiftool.
Actual behavior:
The duration of the video file in OpenShot does not match the duration reported by exiftool.
Relevant files:
The issue can be reproduced using the 'Screencast.webm' file, which unfortunately cannot be attached here due to its size. Please let me know if there is any additional information or files I can provide to assist in resolving this issue. openshot-qt.log
Environment:
Please let me know if there's any additional information I can provide to assist in resolving this