Current time: 05-27-2018, 05:54 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Video unavailable from windows agent running wptagent
01-10-2018, 12:51 PM
Post: #1
Bug Video unavailable from windows agent running wptagent
I have a Windows server running wptagent and it seems to be mostly working. My test results show a screenshot, they have the waterfall chart and almost all of the data that we are interested in. However the speed index and the video (I've learned they are related) are missing. I've spent a lot of time reading the debug output from wptagent and I'm not seeing any errors related to recording video. I even spent time digging into the python code to copy some of the assets onto the Desktop so I can inspect the contents. The results.zip file does not have any video in it. ffmpeg appears to be running fine. When I manually run the same ffmpeg command that is run by wptagent I can save an mp4 video recording of the screen without any issues.

At this point I don't know if the issue is on the windows agent or if it is the web server. Since the results.zip file did not contain a video I assume that it is the windows agent.

I'm not sure where else to look at this point. I'm semi-familiar with the python code but not enough to pin point where the issue is happening.
Find all posts by this user
Quote this message in a reply
01-11-2018, 12:17 AM
Post: #2
RE: Video unavailable from windows agent running wptagent
Usually this will happen if the desktop is locked. Does it also fail if you are running the agent while you are logged in and looking at the machine? If you RDP to the machine and disconnect (instead of rebooting) the display will also lock and break video.

It's definitely on the agent side. All of the video capture, processing and analysis is done on the agent.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2018, 02:15 AM
Post: #3
RE: Video unavailable from windows agent running wptagent
One other possibility that I have seen is path issues and a conflict with the ffmpeg installed by Image Magick. I usually download the ffmpeg static build and copy it over the ffmpeg in the image magick install directory to make sure that isn't a problem.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2018, 07:33 AM (This post was last modified: 01-11-2018 07:43 AM by toddsurfs.)
Post: #4
RE: Video unavailable from windows agent running wptagent
(01-11-2018 12:17 AM)pmeenan Wrote:  Usually this will happen if the desktop is locked. Does it also fail if you are running the agent while you are logged in and looking at the machine? If you RDP to the machine and disconnect (instead of rebooting) the display will also lock and break video.

It's definitely on the agent side. All of the video capture, processing and analysis is done on the agent.

Video does fail after a fresh reboot without an RDP session as well as when I'm logged in and looking at the machine. What is interesting is when I run
Code:
ffmpeg -f gdigrab -video_size 1024x768 -framerate 10 -draw_mouse 0 -i desktop -codec:v libx264rgb -crf 0 -preset ultrafast C:\test.mp4
I am able to record a video. I'll check the image magick path now.

(01-11-2018 02:15 AM)pmeenan Wrote:  One other possibility that I have seen is path issues and a conflict with the ffmpeg installed by Image Magick. I usually download the ffmpeg static build and copy it over the ffmpeg in the image magick install directory to make sure that isn't a problem.

I replaced the ffmpeg.exe that was in the ImageMagick folder with the static build and I am getting the same result.
Find all posts by this user
Quote this message in a reply
01-11-2018, 08:34 AM (This post was last modified: 01-11-2018 08:35 AM by toddsurfs.)
Post: #5
RE: Video unavailable from windows agent running wptagent
I've updated this line to place the video on the desktop and it does record video https://github.com/WPO-Foundation/wptage...er.py#L326

I also see "Video file size: 262192" in the debug output
Find all posts by this user
Quote this message in a reply
01-11-2018, 09:57 AM (This post was last modified: 01-11-2018 10:16 AM by toddsurfs.)
Post: #6
RE: Video unavailable from windows agent running wptagent
As I read the code I was wondering a couple of things:
1. The video is not intended to be included in the .zip file, is that correct?
2. For some reason I'm not seeing the video being uploaded separately when I log all of the post_data calls…

This is really puzzling at this point

I don't see any posts in the post_data log to resultimage.php in the log, is that suspect? Dodgy
Find all posts by this user
Quote this message in a reply
01-11-2018, 11:22 AM (This post was last modified: 01-11-2018 11:39 AM by toddsurfs.)
Post: #7
RE: Video unavailable from windows agent running wptagent
A new clue!
When I comment out this line I get a video but it's blank: https://github.com/WPO-Foundation/wptage...ics.py#L87

It seems whatever is going on in visualmetrics.py might be related to my issue? I have been able to see the original mp4 recorded by ffmpeg and it looks fine. Something weird happens when it is passed to visualmetrics.py

Running python visualmetrics.py -c gives me:
ffmpeg: OK
convert: OK
compare: OK
Pillow: OK
SSIM: OK

I saw a lot of imagemagick commands being called from visualmetrics so I decided to re-install it… Solved it!
Find all posts by this user
Quote this message in a reply
01-11-2018, 11:54 AM
Post: #8
RE: Video unavailable from windows agent running wptagent
I'm 99.9% sure it's a ffmpeg version issue and the detection check isn't detecting that the decimate filter is not working correctly. That is behaving pretty much how it was when I had ffmpeg issues. It correctly records but when it extracts the video frames it only gets a single frame.

Grab the latest static build from here: https://ffmpeg.zeranoe.com/builds/

Find every copy of ffmpeg.exe on your system and replace it with the version from the zip.

Profit (hopefully)

I may need to bundle the build with the agent just to be safe.

FWIW, you probably figured it out already but the videos are not uploaded. The agent records the video and passes it to visualmetrics. visualmetrics extracts the frames where something actually changed, crops it to the viewport and calculates a bunch of metrics then the agent uploads the individual frames that were extracted. It's the extraction that is failing (which uses ffmpeg).
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2018, 03:26 PM
Post: #9
RE: Video unavailable from windows agent running wptagent
Thanks for the reply! I'm not sure exactly what it was. I replaced ffmpeg with a static build and I was still having issues. Once I updated ImageMagick and again replaced ffmpeg with the static build it started working. I'm just writing in case anyone else experiences this issue and simply replacing ffmpeg doesn't resolve it, maybe replace both.

On the bright side I'm super familiar with the python code in wptagent now Smile
Find all posts by this user
Quote this message in a reply
02-08-2018, 03:23 AM
Post: #10
RE: Video unavailable from windows agent running wptagent
(01-11-2018 03:26 PM)toddsurfs Wrote:  Thanks for the reply! I'm not sure exactly what it was. I replaced ffmpeg with a static build and I was still having issues. Once I updated ImageMagick and again replaced ffmpeg with the static build it started working. I'm just writing in case anyone else experiences this issue and simply replacing ffmpeg doesn't resolve it, maybe replace both.

On the bright side I'm super familiar with the python code in wptagent now Smile

Thanks for the updates and replies on this thread. I am seeing similar issues and will try the workarounds/fixes suggested.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)