...is not a valid video, audio, or image file.

Bug #1522780 reported by my.swiat
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
Critical
Unassigned

Bug Description

When I want to import any file format of the video material appears that the program does not support it.
How to test the OpenShot-qt, when the program does not allow?

Architecture (64 bits or 32 bits) : 64bit
Operating System & version: Arch linux and Ubuntu 16.04/16.10 (dev)
Installation Method : git
Version of Openshot installed : 2.0
BZR Revision used (if any) :
MLT/melt version: 0.9.8-3
FFmpeg (i.e.libavcodec) version : ffmpeg: 2.8.3
FFmpeg installation : system

When you move a file on the time bar:
preview_thread:INFO onModeChanged
 files_model:INFO updating files model.
 main_window:INFO Loaded project /home/m/o.flv
 files_model:INFO updating files model.
 main_window:INFO Loaded project /home/m/o.mkv
 files_model:INFO updating files model.
 main_window:INFO Loaded project /home/m/o.mov
 files_model:INFO updating files model.
 main_window:INFO Loaded project /home/m/o.mp4
timeline_webview:INFO Dropping file:///home/m/o.flv
 in timeline.
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/openshot_qt-2.0.0-py3.5.egg/openshot_qt/windows/views/timeline_webview.py", line 518, in dropEvent
    data = json.loads(event.mimeData().text())
  File "/usr/local/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Aborted (memory dump)

Revision history for this message
my.swiat (my.swiat) wrote :
Changed in openshot:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 1.5.0
Revision history for this message
Olivier Girard (eolinwen) wrote :

I've got the same error on Manjaro (an arch derivated) and on Linux Mint.

I've identified and informed Jonathan since the beginning of November about this bug in Libopenshot. And with any kind of files (audio, images, videos) and even a file created with the animated 3d title.....................

At first look, the bug with swig seems to came back and despide several update of Libopenshot he is still present.

Now we must be patient and wait the good update.......

Thanks a lot to help us to improve Openshot especially this version.

Revision history for this message
Olivier Girard (eolinwen) wrote :
Download full text (11.3 KiB)

Same thing with the last update

olivier@siriel ~/OpenshotDev/openshot-qt/src $ python3 launch.py
Loaded modules from current directory: /home/olivier/OpenshotDev/openshot-qt/src
      launch:INFO ------------------------------------------------
      launch:INFO OpenShot (version 2.0.0)
      launch:INFO ------------------------------------------------
    language:INFO Qt Detected Languages: ['fr-FR']
    language:INFO LANG Environment Variable: fr_FR.UTF-8
    language:INFO LOCALE Environment Variable: fr_FR
    language:INFO Attempting to load qt_fr_FR.UTF-8 in '/usr/share/qt5/translations'
    language:INFO Attempting to load qt_fr in '/usr/share/qt5/translations'
    language:INFO Attempting to load fr_FR.UTF-8/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Attempting to load fr/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Successfully loaded fr/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Exiting translation system (since we successfully loaded: fr_FR.UTF-8)
link SVGID_18_-5 hasn't been detected!
link SVGID_18_-5 hasn't been detected!
link SVGID_22_-5 hasn't been detected!
link SVGID_24_-2 hasn't been detected!
link SVGID_24_-2 hasn't been detected!
     ui_util:INFO Initializing UI for MainWindow
     ui_util:INFO Binding event MainWindow:actionNew_trigger
     ui_util:WARNING Icon theme document-new not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionOpen_trigger
     ui_util:WARNING Icon theme document-open not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionSave_trigger
     ui_util:WARNING Icon theme document-save not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionUndo_trigger
     ui_util:WARNING Icon theme edit-undo not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionSaveAs_trigger
     ui_util:WARNING Icon theme document-save-as not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportFiles_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportImageSequence_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportTransition_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRedo_trigger
     ui_util:WARNING Icon theme edit-redo not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRemoveClip_trigger
     ui_util:WARNING Icon theme list-remove not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRemoveTransition_trigger
     ui_util:WARNING Icon theme list-remove not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionExportVideo_trigger
     ui_util:WARNING Icon theme media-record not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionUploadVideo_trigger
     ui_util:WARNING Icon theme fol...

Revision history for this message
Olivier Girard (eolinwen) wrote :
Download full text (11.1 KiB)

Same thing with the last update of today : this version is the 0.0.6+0+486+85+201512280846~ubuntu14.04.1

olivier@siriel ~/OpenshotDev/openshot-qt/src $ python3 launch.py
Loaded modules from current directory: /home/olivier/OpenshotDev/openshot-qt/src
      launch:INFO ------------------------------------------------
      launch:INFO OpenShot (version 2.0.0)
      launch:INFO ------------------------------------------------
    language:INFO Qt Detected Languages: ['fr-FR']
    language:INFO LANG Environment Variable: fr_FR.UTF-8
    language:INFO LOCALE Environment Variable: fr_FR
    language:INFO Attempting to load qt_fr_FR.UTF-8 in '/usr/share/qt5/translations'
    language:INFO Attempting to load qt_fr in '/usr/share/qt5/translations'
    language:INFO Attempting to load fr_FR.UTF-8/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Attempting to load fr/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Successfully loaded fr/LC_MESSAGES/OpenShot in '/home/olivier/OpenshotDev/openshot-qt/src/locale'
    language:INFO Exiting translation system (since we successfully loaded: fr_FR.UTF-8)
link SVGID_18_-5 hasn't been detected!
link SVGID_18_-5 hasn't been detected!
link SVGID_22_-5 hasn't been detected!
link SVGID_24_-2 hasn't been detected!
link SVGID_24_-2 hasn't been detected!
     ui_util:INFO Initializing UI for MainWindow
     ui_util:INFO Binding event MainWindow:actionNew_trigger
     ui_util:WARNING Icon theme document-new not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionOpen_trigger
     ui_util:WARNING Icon theme document-open not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionSave_trigger
     ui_util:WARNING Icon theme document-save not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionUndo_trigger
     ui_util:WARNING Icon theme edit-undo not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionSaveAs_trigger
     ui_util:WARNING Icon theme document-save-as not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportFiles_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportImageSequence_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionImportTransition_trigger
     ui_util:WARNING Icon theme list-add not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRedo_trigger
     ui_util:WARNING Icon theme edit-redo not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRemoveClip_trigger
     ui_util:WARNING Icon theme list-remove not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionRemoveTransition_trigger
     ui_util:WARNING Icon theme list-remove not found. Will use backup icon.
     ui_util:INFO Binding event MainWindow:actionExportVideo_trigger
     ui_util:WARNING Icon theme media-record not found. Will use backup icon.
     ui_util:INFO Binding event...

Revision history for this message
Yohann (psn-w) wrote :

The problem come from local settings:
My local is french, in french we use "," for "." on float number.
JSON generated from importing a file is corrumpted exemple:
The field with french local is:
    "duration" : 113,1296844482422,

     !!!! Duration = 113 next field is 1296844482422 without value !!!!

With english local:
    "duration" : 113.1296844482422,

# {
        # "acodec" : "",
        # "audio_bit_rate" : 0,
        # "audio_stream_index" : -1,
        # "audio_timebase" : {
        # "den" : 1,
        # "num" : 1
        # },
        # "channel_layout" : 4,
        # "channels" : 0,
        # "display_ratio" : {
        # "den" : 9,
        # "num" : 16
        # },
        # "duration" : 113,1296844482422,
        # "file_size" : "565232681",
        # "fps" : {
        # "den" : 1001,
        # "num" : 60000
        # },
        # "has_audio" : false,
        # "has_single_image" : false,
        # "has_video" : true,
        # "height" : 1080,
        # "interlaced_frame" : false,
        # "path" : "/home/yoran/Vidéos/DJI_0024.MP4",
        # "pixel_format" : 0,
        # "pixel_ratio" : {
        # "den" : 1,
        # "num" : 1
        # },
        # "sample_rate" : 0,
        # "top_field_first" : true,
        # "type" : "FFmpegReader",
        # "vcodec" : "h264",
        # "video_bit_rate" : 39970601,
        # "video_length" : "6781",
        # "video_stream_index" : 0,
        # "video_timebase" : {
        # "den" : 60000,
        # "num" : 1
        # },
        # "width" : 1920
        # }

Solution :

You need to force local here : openshot-qt/src/windows/views/files_listview.py

Insert this at line 41:

  import locale
  locale.setlocale(locale.LC_ALL, 'en_GB.utf8')

Revision history for this message
Olivier Girard (eolinwen) wrote :
Download full text (3.2 KiB)

Hi Yohan,

Thanks for the trick. Hovewer, it doesn't work for me. Same result with the last update of LInux mint and Manjaro.

ON Manjaro

[olivier@thorielle src]$ python launch.py
Loaded modules from current directory: /home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src
Traceback (most recent call last):
  File "launch.py", line 77, in <module>
    main()
  File "launch.py", line 70, in main
    app = OpenShotApp(sys.argv)
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/classes/app.py", line 103, in __init__
    from windows.main_window import MainWindow
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/main_window.py", line 47, in <module>
    from windows.views.files_listview import FilesListView
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/views/files_listview.py", line 43, in <module>
    locale.setlocale(locale.LC_ALL, 'en_GB.UTF-8')
  File "/usr/lib/python3.5/locale.py", line 595, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
[olivier@thorielle src]$ python launch.py
Loaded modules from current directory: /home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src
Traceback (most recent call last):
  File "launch.py", line 77, in <module>
    main()
  File "launch.py", line 70, in main
    app = OpenShotApp(sys.argv)
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/classes/app.py", line 103, in __init__
    from windows.main_window import MainWindow
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/main_window.py", line 47, in <module>
    from windows.views.files_listview import FilesListView
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/views/files_listview.py", line 43, in <module>
    locale.setlocale(locale.LC_ALL, 'en_GB.utf-8')
  File "/usr/lib/python3.5/locale.py", line 595, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

[olivier@thorielle src]$ python launch.py
Loaded modules from current directory: /home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src
Traceback (most recent call last):
  File "launch.py", line 77, in <module>
    main()
  File "launch.py", line 70, in main
    app = OpenShotApp(sys.argv)
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/classes/app.py", line 103, in __init__
    from windows.main_window import MainWindow
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/main_window.py", line 47, in <module>
    from windows.views.files_listview import FilesListView
  File "/home/olivier/OpenshotDev/GitopenshotDev/openshot-qt/src/windows/views/files_listview.py", line 43, in <module>
    locale.setlocale(locale.LC_ALL, 'en_GB.utf8')
  File "/usr/lib/python3.5/locale.py", line 595, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

from classes.logger import log
from classes.query import File
from classes.app import get_app
from windows.models.files_model import FilesModel

import locale
locale.setlocale(locale.LC_ALL, 'en_GB.utf8')

try:
    import json
except ImportError:
    import simplejson...

Read more...

Revision history for this message
Yohann (psn-w) wrote :

Okay i know why it's not working you don't have locale en_GB.utf8 generated on your linux.
You can generate : https://wiki.archlinux.org/index.php/Locale

You can choose an other locale i.e en_US.utf8.

Do this command to show your current generated local :
   $ locale -a
C
C.UTF-8
           en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
          en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
fr_FR.utf8
fr_LU.utf8

Generating locales

Before a locale can be enabled on the system, it has to be generated. The current generated/available locales can be viewed with:

$ locale -a

Revision history for this message
my.swiat (my.swiat) wrote :

I added to openshot-qt/src/windows/views/files_listview.py appropriate (given lines) with the appropriate indication .utf8.
Not worked.

I decided to use another solution.
Instead, for example: en_GB.utf8 - I put between brackets C:

import locale
locale.setlocale(locale.LC_ALL, 'C')

I made the command:
sudo python setup.py install

I run the OpenShot-qt.
The result: the program has opened my .flv file without a problem, .mkv, .mov and .mp4
:)

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

Thanks a lot Yohann and my.swiat.

A quick test on Linux mint 17.2 using the both methods and that works with the last update of this year of LibOpenshot and the rev.

ON LMInt my locale are :
 olivier@siriel ~ $ locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
                    en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
                  en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
                fr_FR.utf8
fr_LU.utf8
POSIX

I have not run the setup but just like usual the following command in the src folder after updating the branch.
python3 launch.py

I have been able to run a 4K film and another one in the same time.
Great

Revision history for this message
Olivier Girard (eolinwen) wrote : Re: [Openshot.bugs] [Bug 1522780] Re: ...is not a valid video, audio, or image file.
Download full text (3.8 KiB)

Rev 849.
Hovewer, the player run slowly with a 4K.

Soon, I'll test on Manjaro.

2016-01-07 18:25 GMT+01:00 Olivier Girard <email address hidden>:

> Thanks a lot Yohann and my.swiat.
>
> A quick test on Linux mint 17.2 using the both methods and that works
> with the last update of this year of LibOpenshot and the rev.
>
> ON LMInt my locale are :
> olivier@siriel ~ $ locale -a
> C
> C.UTF-8
> en_AG
> en_AG.utf8
> en_AU.utf8
> en_BW.utf8
> en_CA.utf8
> en_DK.utf8
> en_GB.utf8
> en_HK.utf8
> en_IE.utf8
> en_IN
> en_IN.utf8
> en_NG
> en_NG.utf8
> en_NZ.utf8
> en_PH.utf8
> en_SG.utf8
> en_US.utf8
> en_ZA.utf8
> en_ZM
> en_ZM.utf8
> en_ZW.utf8
> fr_BE.utf8
> fr_CA.utf8
> fr_CH.utf8
> fr_FR.utf8
> fr_LU.utf8
> POSIX
>
> I have not run the setup but just like usual the following command in the
> src folder after updating the branch.
> python3 launch.py
>
> I have been able to run a 4K film and another one in the same time.
> Great
>
> --
> You received this bug notification because you are a member of OpenShot
> Bugs, which is subscribed to OpenShot Video Editor.
> https://bugs.launchpad.net/bugs/1522780
>
> Title:
> ...is not a valid video, audio, or image file.
>
> Status in OpenShot Video Editor:
> Confirmed
>
> Bug description:
> When I want to import any file format of the video material appears that
> the program does not support it.
> How to test the OpenShot-qt, when the program does not allow?
>
> Architecture (64 bits or 32 bits) : 64bit
> Operating System & version: Arch linux and Ubuntu 16.04/16.10 (dev)
> Installation Method : git
> Version of Openshot installed : 2.0
> BZR Revision used (if any) :
> MLT/melt version: 0.9.8-3
> FFmpeg (i.e.libavcodec) version : ffmpeg: 2.8.3
> FFmpeg installation : system
>
> When you move a file on the time bar:
> preview_thread:INFO onModeChanged
> files_model:INFO updating files model.
> main_window:INFO Loaded project /home/m/o.flv
> files_model:INFO updating files model.
> main_window:INFO Loaded project /home/m/o.mkv
> files_model:INFO updating files model.
> main_window:INFO Loaded project /home/m/o.mov
> files_model:INFO updating files model.
> main_window:INFO Loaded project /home/m/o.mp4
> timeline_webview:INFO Dropping file:///home/m/o.flv
> in timeline.
> Traceback (most recent call last):
> File
> "/usr/lib/python3.5/site-packages/openshot_qt-2.0.0-py3.5.egg/openshot_qt/windows/views/timeline_webview.py",
> line 518, in dropEvent
> data = json.loads(event.mimeData().text())
> File "/usr/local/lib/python3.5/json/__init__.py", line 319, in loads
> return _default_decoder.decode(s)
> File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
> obj, end = self.raw_decode(s, idx=_w(s, 0).end())
> File "/usr/local/lib/python3.5/json/decoder.py", line 357, in
> raw_decode
> raise JSONDecodeError("Expecting value", s, err.value) from None
> json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
> Aborted (memory dump)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openshot/+bug/1522780...

Read more...

my.swiat (my.swiat)
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.