maxrd2 / SubtitleComposer

Subtitle Composer - KF5/Qt Video Subtitle Editor
Other
238 stars 29 forks source link

Control the video playback speed #70

Closed luzfcb closed 7 years ago

luzfcb commented 7 years ago

Hello, it would be great if I could control the playback speed of the video like VLC does.

If this functionality already exists, could you let me know how I can use it.

maxrd2 commented 7 years ago

There isn't function for that yet. Will be adding it soon.

maxrd2 commented 7 years ago

Added support for playback rate change on MPV and GStreamer backends. GStreamer needs scaletempo plugin for pitch correction (should be in plugins-good).

luzfcb commented 7 years ago

@maxrd2 First, thanks for the extremely fast response, and for creating the initial implementation so quickly.

I would like to compile from the master branch, but I'm not a C ++ / QT programmer so I do not know exactly how to do this. (I did not find documentation on how to compile this project). So the questions are: What are the build dependencies I have to install on Ubuntu 16.04? What commands do I need to run to compile?

when had to document the dependencies of another project i participated in, and my solution was this:

install_os_dependencies.sh and requirements-xenial.apt

Martchus commented 7 years ago

See discussion in issue #69.

luzfcb commented 7 years ago

@Martchus Hello, I had this problem and I still have not figured out how to solve it. Do you have any idea of what I can do?

[ 23%] Building CXX object src/main/CMakeFiles/subtitlecomposer.dir/configs/playerconfigwidget.cpp.o
/home/luzfcb/subtitlecomposer/subtitlecomposer-src/src/widgets/waveformwidget.cpp: In member function ‘void SubtitleComposer::WaveformWidget::onConfigChanged()’:
/home/luzfcb/subtitlecomposer/subtitlecomposer-src/src/widgets/waveformwidget.cpp:157:73: error: ‘devicePixelRatioF’ was not declared in this scope
  m_waveInner = QPen(QColor(SCConfig::wfInnerColor()), devicePixelRatioF(), Qt::SolidLine);
                                                                         ^
[ 23%] Building CXX object src/main/CMakeFiles/subtitlecomposer.dir/configs/waveformconfigwidget.cpp.o
[ 24%] Building CXX object src/main/CMakeFiles/subtitlecomposer.dir/dialogs/opensubtitledialog.cpp.o
src/main/CMakeFiles/subtitlecomposer.dir/build.make:822: recipe for target 'src/main/CMakeFiles/subtitlecomposer.dir/__/widgets/waveformwidget.cpp.o' failed
make[2]: *** [src/main/CMakeFiles/subtitlecomposer.dir/__/widgets/waveformwidget.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1762: recipe for target 'src/main/CMakeFiles/subtitlecomposer.dir/all' failed
make[1]: *** [src/main/CMakeFiles/subtitlecomposer.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

At the moment, these were the packages I discovered were needed to compile subtitlecomposer.

https://github.com/luzfcb/subtitlecomposer/blob/ubuntu-16-04-compile-requirements/dev_requirements/requirements-xenial.apt

live logging of configuration and compilation: https://asciinema.org/a/107826

maxrd2 commented 7 years ago

Seems you are using Qt version < 5.6 which doesn't have QPaintDevice::devicePixelRatioF() method. If you cannot update Qt, issue this command before starting cmake. git revert 956104a95b8e971391684d87cf122eb4b9d92385

luzfcb commented 7 years ago

@maxrd2 In the Ubuntu 16.04 repository is only available QT 5.5.1

I finally managed to compile with the following modifications https://github.com/luzfcb/subtitlecomposer/commit/60aeef81b35cb0747f372f1ff55ca80d56d768f6

The binary file is generated. But after opening the binary, the application menus are gone.

I can only open a caption file if I use the command line.

I do not know if the menus problem is related to this error message : cannot find .rc file "subtitlecomposerui.rc" for component "subtitlecomposer"

fabio@luzfcb:~/subtitlecomposer/bin$ ./subtitlecomposer  /home/fabio/curso_wttd_2016/modulo1/M1A10-_Por_dentro_do_import.srt
Loaded VideoPlayer plugin "GStreamer" from "/home/fabio/subtitlecomposer/lib/subtitlecomposer/gstplayer.so"
Loaded VideoPlayer plugin "MPlayer" from "/home/fabio/subtitlecomposer/lib/subtitlecomposer/mplayer.so"
Loaded VideoPlayer plugin "MPV" from "/home/fabio/subtitlecomposer/lib/subtitlecomposer/mpvplayer.so"
Loaded VideoPlayer plugin "Phonon" from "/home/fabio/subtitlecomposer/lib/subtitlecomposer/phononplayer.so"
Loaded VideoPlayer plugin "Xine" from "/home/fabio/subtitlecomposer/lib/subtitlecomposer/xineplayer.so"
cannot find .rc file "subtitlecomposerui.rc" for component "subtitlecomposer"

I had to compile without speechplugins, because if i not add a comment on this line: https://github.com/luzfcb/subtitlecomposer/blob/compile-on-16.04/src/CMakeLists.txt#L49 i got this error:

[ 94%] Building CXX object src/videoplayerplugins/xine/CMakeFiles/xineplayer.dir/xineconfigwidget.cpp.o
/home/fabio/subtitlecomposer/subtitlecomposer-src/src/speechplugins/pocketsphinx/pocketsphinxplugin.cpp: In member function ‘void SubtitleComposer::PocketSphinxPlugin::processUtterance()’:
/home/fabio/subtitlecomposer/subtitlecomposer-src/src/speechplugins/pocketsphinx/pocketsphinxplugin.cpp:99:42: error: too few arguments to function ‘ps_seg_t* ps_seg_iter(ps_decoder_t*, int32*)’
  ps_seg_t *iter = ps_seg_iter(m_psDecoder);
                                          ^
In file included from /home/fabio/subtitlecomposer/subtitlecomposer-src/src/speechplugins/pocketsphinx/pocketsphinxplugin.cpp:25:0:
/usr/include/pocketsphinx/pocketsphinx.h:462:11: note: declared here
 ps_seg_t *ps_seg_iter(ps_decoder_t *ps, int32 *out_best_score);
           ^
src/speechplugins/pocketsphinx/CMakeFiles/pocketsphinxasr.dir/build.make:62: recipe for target 'src/speechplugins/pocketsphinx/CMakeFiles/pocketsphinxasr.dir/pocketsphinxplugin.cpp.o' failed
make[2]: *** [src/speechplugins/pocketsphinx/CMakeFiles/pocketsphinxasr.dir/pocketsphinxplugin.cpp.o] Error 1
CMakeFiles/Makefile2:2530: recipe for target 'src/speechplugins/pocketsphinx/CMakeFiles/pocketsphinxasr.dir/all' failed
make[1]: *** [src/speechplugins/pocketsphinx/CMakeFiles/pocketsphinxasr.dir/all] Error 2
make[1]: ** Esperando que outros processos terminem.
[ 94%] Building CXX object src/videoplayerplugins/xine/CMakeFiles/xineplayer.dir/__/__/videoplayer/videoplayer.cpp.o
[ 95%] Building CXX object src/videoplayerplugins/xine/CMakeFiles/xineplayer.dir/__/scconfigdummy.cpp.o
[ 95%] Building CXX object src/videoplayerplugins/xine/CMakeFiles/xineplayer.dir/xineplayer_automoc.cpp.o
[ 96%] Linking CXX shared module xineplayer.so
[ 97%] Built target xineplayer
Makefile:116: recipe for target 'all' failed

Maybe this is also a problem with version of libpocketsphinx-dev. the instaled version is 0.8.0

Thank you very much for this software. And thank you for giving me some of your precious time.

maxrd2 commented 7 years ago

File subtitlecomposerui.rc contains a list of actions in main menus, am not sure why it can't be found in your case. You did execute 'make install'?

Pocketsphinx changed the signature of few functions some time ago, your repository contains a bit outdated pocketsphinx, that's why you're getting that error. Pocketsphinx is used for speech recognition only, subtitle composer will work without it too.

luzfcb commented 7 years ago

@maxrd2 About the version pocketsphinx problem, i compile sphinxbase and pocketsphinx from the source code, both using the following commands

./autogen.sh --enable-static=no --prefix=/usr
make
sudo make install

About the problem of the menus do not appear, i discovered that if I compile subtitlecomposer using the instructions from https://github.com/maxrd2/subtitlecomposer/issues/69#issuecomment-287506325, kxmlgui5 can not find $HOME/subtitlecomposer/share/kxmlgui5/subtitlecomposer/subtitlecomposerui.rc

It was necessary to copy $HOME/subtitlecomposer/share/kxmlgui5/subtitlecomposer/ to /usr/share/kxmlgui5/

sudo cp -R $HOME/subtitlecomposer/share/kxmlgui5/subtitlecomposer/ /usr/share/kxmlgui5/

Would this be a bug in subtitlecomposer or is the expected behavior?

Martchus commented 7 years ago

I would say bug. The lookup should take your custom install prefix into account.

BTW: In general you shouldn't use --prefix=/usr and sudo make install. Using another install prefix, eg. the one you already use for subtitle composer itself ($HOME/subtitlecomposer), is preferable to avoid conflicts with the packaged version of the library.

maxrd2 commented 7 years ago

It's not a bug in subtitlecomposer, kxmlgui searches for .rc files in QStandardPaths::GenericDataLocation. Try starting subtitlecomposer like this:

XDG_DATA_HOME=$HOME/subtitlecomposer/share subtitlecomposer

EDIT: corrected the path

Martchus commented 7 years ago

Ok, good to know. It would be great if kxmlgui would print that information in case of failed lookup, though.

luzfcb commented 7 years ago

@maxrd2 with this command work

XDG_DATA_HOME=$HOME/subtitlecomposer/share $HOME/subtitlecomposer/bin/subtitlecomposer
maxrd2 commented 7 years ago

Have added better instructions for building it from sources here: https://github.com/maxrd2/subtitlecomposer/wiki/Building-from-sources

luzfcb commented 7 years ago

@maxrd2 about build from source instructions.

Only worked correctly, after add XDG_DATA_HOME to Exec section of subtitlecomposer.desktop

change from:

Exec=/opt/subtitlecomposer/bin/subtitlecomposer %f

to:

Exec=XDG_DATA_HOME=/opt/subtitlecomposer/share /opt/subtitlecomposer/bin/subtitlecomposer %f
maxrd2 commented 7 years ago

Strange it worked here... Anyway have updated the wiki page and command. Thank you

maxrd2 commented 7 years ago

Closing now.. feel free to reopen if something is missing