curtwagner1984 / YAPO

Yapo - Yet Another Porn Organizer
GNU General Public License v3.0
48 stars 10 forks source link

[Bug] Generate Sample Video not working on Linux #13

Closed sjclayton closed 8 years ago

sjclayton commented 8 years ago

I tried the modification you posted in the forum on Emp adding single quotes to that line in ffmpeg_process.py worked for me, and it generated the sample video... I didn't really want to change it here however and make a new commit after having fixed it as I don't quite remember how Windows handles single quotes on the command line.

Here is the corrected line:

scale_argument = "-vf scale={},'pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2'".format(SAMPLE_RESOLUTION)

The only issue now is that after generating the sample video the code that is supposed to remove the temp image files isn't working. But I think I may be able to fix it.

sjclayton commented 8 years ago

I fixed the issue with the temp files not being removed after the sample video is generated -- pushed in my latest pull request, and I'm also going to submit the adjustment made to the line I mentioned above... let me know if it breaks anything on Windows @curtwagner1984

curtwagner1984 commented 8 years ago

It does indeed break the sample generation on windows: No such filter: 'pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2'\r\nError opening filters!\r\n"

It's strange... Does it work on linux with generating screenshots for the scenes on import? It uses the same padding argument: FFMPEG_SCREENSHOT_ARGUMENTS = "-vf \"thumbnail,scale=1280:720,pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2\" -frames:v 1"

As the scale argument: scale_argument = "-vf scale={},'pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2'".format(SAMPLE_RESOLUTION)

sjclayton commented 8 years ago

@curtwagner1984 - I have not checked to see if it works on import or not.... I will do so... but I know that it didn't work generating them afterwards without adding those single quotes to the scale_argument line.

Something has to be able to be figured out to get it to work, or else OS specific code will need to be added, so that it runs with the correct quoting (single on Linux and no quotes on Windows)...

EDIT : There has to be some other way to get it to work on both without adding in OS detection for that whole chunk of code.

EDIT 2 : Sorry I misread your last comment, yes it does work on import for generating the screenshots just fine without the single quotes around the padding argument... =P

However I just tried to import a new folder and generate the sample videos on import, and it didn't even attempt to do it, let alone throw an error of any sort... Even with the 'Create Sample Video?' check box checked it gave this when it completed.... saying the createSampleVideo box wasn't checked even though it was...

[25/Aug/2016 07:47:08] "GET /add-items/?actorsToAdd=&createSampleVideo=false&folderToAddPath=%2Fmedia%2Fshaun%2FArchive%2FPorn%2FAlaina+Dawson HTTP/1.1" 200

sjclayton commented 8 years ago

Fixed it!!! =D Newest pull request will have the fixed code that should work on both OSes....

The arguments being passed to ffmpeg needed to be escaped or treated as a regex... like in the line:

FFMPEG_SCREENSHOT_ARGUMENTS = "-vf \"thumbnail,scale=1280:720,pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2\" -frames:v 1"

So the scale_argument line now looks like this:

scale_argument = "-vf \"scale={},pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2\"".format(SAMPLE_RESOLUTION)

But the above issue I mentioned about it not doing anything when the Create Sample box is checked on import still exists... but I'm going to say that's a separate issue all together.

curtwagner1984 commented 8 years ago

Tested and it works on windows as well! Cheers!

" but I'm going to say that's a separate issue all together."

Indeed. Open another issue for that and I'll consider this one closed.

sjclayton commented 8 years ago

@curtwagner1984 I opened a new issue for the other bug. You can close this now!