Page 1 of 1

Microlags when Transcoding Video

PostPosted: Tue Feb 25, 2014 9:33 pm
by SilentHunter124
Hi *,

I have a serious problem when transcoding a video with the Panasonic Viera 2010 Profile for a Panasonic DMR.
The video is lagging after every 10 seconds for a few milliseconds. This remains until the film is ending.

I checked if these lags are also in the transcoded tmp files. But no lag here, the transcoded videos are ok. Then I tried to find out which command is used and found this command:

  Code:
ffmpeg -threads 2 -i /home/dlna/video/IronMan/IRON_MAN_1_HD.mkv -y -threads 2 -c:v mpeg2video -pix_fmt yuv420p -qscale:v 3 -r 24000/1001 -g 15 -c:a ac3 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-1716-viera2010-ORIGINAL.stf


After running this command manually I could check that the video is converted with round about 47 FPS. That is enough right?
The network is also not the problem because I can wach HD (BluRay) videos over another media server in full quality without any problems.

So where can be the problem. My knowledge is limited about this video stuff... I am just computer scientist ;)

Re: Microlags when Transcoding Video

PostPosted: Wed Feb 26, 2014 12:01 am
by DenyAll
Monitor your CPU usage while transcoding. Look to see what processes are using CPU and if anything is spiking every 10 seconds or so. The ffmpeg conversion rate should 2-3 times the video framerate so the 47 FPS conversion rate you are getting should be OK, but it doesn't mean something else isn't chewing CPU cycles, or that it isn't hard drive related (have you plenty of free space on the temp folder drive, and its a normal drive, not a SSD), memory related, etc.

What do you mean by lagging - is it freezing, is video and audio out of sync? What happens if you pause the video for a significant duration (until transcoding is finished - monitor your CPU usage, showing all processes, until ffmpeg finishes) and then resume the video - does it lag then? Also, ensure your Java version is up to date/ your ffmpeg version is also up to date (if linux). Try setting the number of CPU's on the Transcoding tab in Serviio console to the maximum you have.

Also (just checking) - if new user, has Serviio finished its library build (Serviio Console, Library tab - Show Status, both lights should be red).

But no lag here, the transcoded videos are ok
How did you check - try renaming the .stf file to .mpg and moving it to your library, refresh and play it through Serviio.

I can watch HD (BluRay) videos over another media server in full quality without any problems
From this PC?

Re: Microlags when Transcoding Video

PostPosted: Wed Feb 26, 2014 8:54 pm
by SilentHunter124
Hi,

the CPU usage is all right. Serviio uses 4 of 8 Cores the highest CPU usage was 65%. I have 16 TB HDD in a RAID 0+1 (Hardware RAID) with normal 7k rpms and SATA-III. Java and FFMPEG are the newest version.

What do you mean by lagging - is it freezing, is video and audio out of sync?


The audio and the video is hanging for a few milliseconds (this is meant by lag).

What happens if you pause the video for a significant duration (until transcoding is finished - monitor your CPU usage, showing all processes, until ffmpeg finishes) and then resume the video - does it lag then?


And here is the problem I can not pause the video. If I do so and press play again, the panasonic device does not go on just hangs on the position I paused the video.

Also (just checking) - if new user, has Serviio finished its library build (Serviio Console, Library tab - Show Status, both lights should be red).


Status lights are red.

How did you check - try renaming the .stf file to .mpg and moving it to your library, refresh and play it through Serviio.


No I downloaded the stf file and played it with vlc media player locally.

From this PC?


No it is a sony home theatre system which can play nearly all formats, so this device is using the generic dlna profile. I can watch the same video in the original quality via serviio generic profile without any problems.

Re: Microlags when Transcoding Video

PostPosted: Wed Feb 26, 2014 11:58 pm
by DenyAll
Try renaming and playing the .stf via Serviio on your TV. Basically I am trying to work out whether the lagging is caused by the process of transcoding (eg CPU load etc - doesn't seem to be the case) or is embedded in the end product (ie. your TV cannot play the transcoded file smoothly).

Can you also post MediaInfo detail for the original file.

Re: Microlags when Transcoding Video

PostPosted: Thu Mar 06, 2014 12:18 pm
by SilentHunter124
Ok. I renamed the .stf and played it via Serviio on the Panasonic. The laggs are still there. When I play the same file via Serviio over my Home Theatre all works great.

What can be the problem?

Re: Microlags when Transcoding Video

PostPosted: Thu Mar 06, 2014 12:31 pm
by DenyAll
When I play the same file via Serviio over my Home Theatre all works great.
What's that mean. What is your Home Theatre?

I should have checked a few things with you earlier:

  • Can you play file this with any other profile - try the Generic Profile, and one of the other Panasonic profiles. Also try the Sharp Aquos profile as this simply remuxes MKV's with H264 video, which I assume this is. Remember to press Save after changing the profile (on the Status tab of Serviio Console).
  • Can you please post a MediaInfo details for the original file and the stf file.
  • Is it only this file or all MKV's?
I suspect that your Panasonic DMR cannot keep up with the bit rate of the transcoded movie (hasn't got the processing power). We may have to limit the bit rate unless using one of the other profiles points us to a better option.

Re: Microlags when Transcoding Video

PostPosted: Fri Mar 07, 2014 7:23 am
by SilentHunter124
The Home Theatre is a Sony BDV 6100 System. The Generic profile does not play any videos, the Panasonic profiles also do not. Yesterday I tried the Sharp profile... There seems to play the video, but the screen stays black.
Do you have any tool for getting the MediaInfo from a file? The problem exists in several mkv files but in some other mkv files I have also terrible distortions where there are suddenly colored lines in the video...