Page 1 of 1

Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 11:49 am
by vollschauer
I'm trying to get a mpeg movie to play but no luck so far :/ so I read a bit more carefully the renpy movies reference page...
and it says that a audio track is required. lets add one with ffmpeg (using version 2.8)

original file, mediainfo output:

Code: Select all

General
Complete name                            : input.mpg
Format                                   : MPEG-PS
File size                                : 9.68 MiB
Duration                                 : 10s 0ms
Overall bit rate                         : 8 123 Kbps
Writing library                          : encoded by TMPGEnc (ver. 2.525.64.184)

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 1
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=3, N=9
Duration                                 : 10s 0ms
Bit rate                                 : 8 000 Kbps
Width                                    : 800 pixels
Height                                   : 600 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.556
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 9.49 MiB (98%)
Writing library                          : TMPGEnc 2.525.64.184
I searched the web and came up with this:

Code: Select all

ffmpeg -f lavfi -i aevalsrc=0 -i input.mpg -vcodec copy -acodec mp2 -ab 128000 -map 0:0 -map 1:0 -shortest -strict experimental -y out.mpg
mediainfo output:

Code: Select all

General
Complete name                            : out.mpg
Format                                   : MPEG-PS
File size                                : 9.73 MiB
Duration                                 : 10s 0ms
Overall bit rate                         : 8 163 Kbps
Writing library                          : encoded by TMPGEnc (ver. 2.525.64.184)

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 1
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=3, N=9
Duration                                 : 10s 0ms
Bit rate                                 : 7 872 Kbps
Maximum bit rate                         : 8 000 Kbps
Width                                    : 800 pixels
Height                                   : 600 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.547
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 9.38 MiB (96%)
Writing library                          : TMPGEnc 2.525.64.184

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Duration                                 : 9s 979ms
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel count                            : 1 channel
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Delay relative to video                  : -11ms
Stream size                              : 156 KiB (2%)
The move is now "playing" but stuttering like hell? What I'm doing wrong?

Thanks ...

Re: Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 2:47 pm
by Donmai
vollschauer wrote:What I'm doing wrong?
You are using mpeg. Have you tried OGG or webm?

Re: Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 3:11 pm
by vollschauer
yeah no luck with ogg audio neither, so i decided to give up and convert all my mpeg's to ogv

Code: Select all

ffmpeg -ar 48000 -ac 2 -f s16le -i /dev/zero -i input.mpg -c:v libtheora -c:a libvorbis -q:v 10 -q:a 4 -shortest -strict experimental -y out.ogv
at least they a playing now :D

Re: Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 3:43 pm
by Jae
Ren'Py is fickle.

Just stick to .ogv for videos and .ogg for audio tracks.

Re: Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 5:04 pm
by vollschauer
I will :D now I face another issue my scene jumps in before the movie has played to the end ...is that normal behavior?

Code: Select all

play movie "video/out.ogv"
scene cg xxx with flash
inserting a pause seems silly!?

Edit:
Found out myself, looks it there is quite a difference to

Code: Select all

$ renpy.movie_cutscene("video/out.ogv")

Re: Mpeg Movie won't play ...

Posted: Sun Oct 11, 2015 7:32 pm
by Donmai
Donmai wrote:Have you tried OGG or webm?
My bad, of course I meant OGG Video. BTW, webm seems to be the way to go.

Re: Mpeg Movie won't play ...

Posted: Sat Oct 17, 2015 6:12 pm
by vollschauer
Didn't even know webm before you told me ;) I checked it out and have to say nice compression!

But my movie "lags" if I loop it (little stutter between the loops, it's not playing smooth)...
If I watch my movies (with loop) in mpv player all is fine, you cant see where the start/end is.

I use this code:

Code: Select all

init:
    image movie = Movie (size=(config.screen_width, config.screen_height), xalign=0.0, yalign=0.0)

Code: Select all

        show movie 
        play movie "video/movie_01.webm" loop
Doesn't matter if I use webm or ogv.

Re: Mpeg Movie won't play ...

Posted: Thu Dec 03, 2015 1:43 pm
by vollschauer
Getting my movies to work is still on my big TO-DO list. As I mention my mpegs don't work, they are stuttering like hell ...
Then I had a look at the free game on steam "Written in the Sky" and noticed they used a mpeg for they intro.

My mpg (not working!):

Code: Select all

Format                                   : MPEG-PS
File size                                : 79.6 MiB
Duration                                 : 2mn 5s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 318 Kbps
Writing library                          : encoded by TMPGEnc (ver. 2.524.63.181)

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 1
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=18
Duration                                 : 2mn 5s
Bit rate mode                            : Variable
Bit rate                                 : 5 084 Kbps
Width                                    : 800 pixels
Height                                   : 600 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 30.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.353
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Open
GOP, Open/Closed of first frame          : Closed
Stream size                              : 76.1 MiB (96%)
Writing library                          : TMPGEnc 2.524.63.181

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Duration                                 : 2mn 5s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 1.92 MiB (2%)
Written in the Sky mpg (working!):

Code: Select all

Format                                   : MPEG-PS
File size                                : 1.07 MiB
Duration                                 : 8s 255ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 084 Kbps

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 1
Format settings, BVOP                    : No
Format settings, Matrix                  : Default
Format settings, GOP                     : N=12
Duration                                 : 8s 0ms
Bit rate mode                            : Variable
Bit rate                                 : 934 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.018
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Open
GOP, Open/Closed of first frame          : Closed
Stream size                              : 912 KiB (84%)

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Duration                                 : 8s 255ms
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Delay relative to video                  : -25ms
Stream size                              : 129 KiB (12%)
Does anybody know why this one is working and the other not? I also tried ogv which is much better, but I still have that lag/delay between the loops ... :/

Re: Mpeg Movie won't play ...

Posted: Fri Dec 04, 2015 1:57 am
by Jae
Forget everything and use .webm.

V8 video codec and Vorbis audio.

I've had issues with different file formats in the past with Ren'Py. Switched to .webm for everything and never had another issue ever again with any machines I've tested on.

Re: Mpeg Movie won't play ...

Posted: Thu Dec 10, 2015 11:40 am
by vollschauer
I've tried every format by now, still getting the "loop lag"
(I'm running Linux btw.)

Re: Mpeg Movie won't play ...

Posted: Thu Dec 10, 2015 12:36 pm
by Donmai
Check your video file, then. Can it loop properly?

Re: Mpeg Movie won't play ...

Posted: Sat Dec 26, 2015 10:26 am
by vollschauer
I have tried now every format I guess. Anyway, I captured my screen to show what I'm talking about.
https://www.youtube.com/watch?v=rw26Tv8RIAc

Re: Mpeg Movie won't play ...

Posted: Sat Dec 26, 2015 1:22 pm
by Donmai
Well... calling Ren'Py technicians...