FLAC Support

Bug #602638 reported by Thangalin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
Medium
Andy Finch

Bug Description

Wish list: FLAC audio file support.

Revision history for this message
Olivier Girard (eolinwen) wrote :

Done.but i don't know if Ffmpeg manage it. And i think (and nearly sure ) that Transcode can 't do it too.

Changed in openshot:
importance: Undecided → Wishlist
Andy Finch (fincha)
Changed in openshot:
status: New → Triaged
Revision history for this message
Andy Finch (fincha) wrote :

FLAC files play ok in melt, but get imported as an image file type in Openshot.

Changed in openshot:
importance: Wishlist → Medium
status: Triaged → Confirmed
Revision history for this message
Andy Finch (fincha) wrote :

I've found a way (via MLT) to improve the methods we use to identify the file type, which results in FLAC files being imported properly (the new method also allows us to get extra information about the files, so we can provide more info about the file).

This will have to wait a while though, as we're in the final stages of the 1.3 release.

Changed in openshot:
assignee: nobody → Andy Finch (fincha)
Revision history for this message
Thangalin (thangalin-deactivatedaccount) wrote :

Looking forward to it, Andy.

Thank you!

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

It looks like MLT and even FFmpeg identify the FLAC format as having no length. So, even if we can get the file identified correctly, it will probably still crash OpenShot when it thinks it's a longer file than it really is. I know Kdenlive also suffers from this bug.

Revision history for this message
Andy Finch (fincha) wrote :

Additional code in thumbnail.py such as the below (indentation will probably get lost), will allow flac files to be imported properly. I haven't submitted it as a patch yet, as I wanted to spend more time testing it all out, but it seems to work.

 audio_index = self.p.get_int("audio_index")
    video_index = self.p.get_int("video_index")
    audio_property = "meta.media.%s.codec.long_name" % audio_index
    if self.p.get(audio_property):
     audio_codec = self.p.get(audio_property)
    else:
     audio_codec = ""

    video_property = "meta.media.%s.codec.long_name" % video_index
    if self.p.get(video_property):
     video_codec = self.p.get(video_property)
     print self.p.get("meta.media.colorspace")
    else:
     video_codec = ""

    if self.p.get_frame():
     frame = self.p.get_frame()
     frequency = frame.get_int("frequency")
     channels = frame.get_int("channels")

    # determine if this is an image
    is_image = False
    if self.p.get_length() == 15000 and video_index == 0 and audio_index == 0:
     # images always have exactly 15000 frames
                                is_image = True
     self.file_type = "image"

Revision history for this message
Andy Finch (fincha) wrote :

Essentially, images files should have audio_index & video_index = 0, whereas one or other (or both) will be set to 1 for video/audio files.

Revision history for this message
moimael (moimael) wrote :

Is it fixed in 1.4 master ?

Changed in openshot:
milestone: none → 1.4.0
Revision history for this message
Andy Finch (fincha) wrote :

It's not, I need to look at it again, I think there might have been some file length issues.

Revision history for this message
Andy Finch (fincha) wrote :

This is now added to the trunk. You cannot seek within the file, this seems to be a ffmpeg limitation, but Openshot will now import them properly with the correct file length and play them on the timeline.

Changed in openshot:
status: Confirmed → Fix Committed
Andy Finch (fincha)
Changed in openshot:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.