Jump to content

ffmpeg fails when seeking in wtv file


Mfouchi

Recommended Posts

Mfouchi

Hi,

I started this conversation in the Roku forum, but now that I see that it happens in iOS Safari as well, I'm not sure if its client specific, so I'll put it here.

 

When I am viewing a Recorded show in LiveTV, and it tries to transcode, ffmpeg throws errors when I try to skip ahead.  Specifically:

"Failed to compensate for timestamp delta of XXX"

It works properly when I play from the beginning and don't try to jump ahead.

 

This fails when I play from Roku3 and from iOS Safari, but it works properly when I play from Chrome on my PC.

I noticed that the ffmpeg commands are slightly different for each (see below)

ROKU (fail)
ffmpeg.exe -ss 00:16:27.000 -fflags +genpts -async 1 -vsync -1 -i file:"G:\Recorded TV\The Tonight Show Starring Jimmy Fallon_WDSUDT_2014_07_28_22_32_00.wtv" -map_metadata -1 -threads 2 -map 0:2 -map 0:0 -map -0:s -codec:v:0 libx264 -preset superfast -crf 23 -maxrate 4700000 -bufsize 9400000 -r 23.97602 -vsync vfr -profile:v high -level 41 -force_key_frames expr:gte(t,n_forced*7) -vf "scale=trunc(min(iw\,1920)/2)*2:trunc(min((iw/dar)\,1080)/2)*2" -copyts -flags -global_header -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1000,volume=2" -hls_time 7 -start_number 141 -hls_list_size 1440 -y "C:\Users\Fouchi\AppData\Roaming\MediaBrowser-Server\transcoding-temp\8e91c7320a58366da4e2d8e741a2554e.m3u8"
iOS (fail)
ffmpeg.exe -ss 00:10:37.000 -fflags +genpts -async 1 -vsync -1 -i file:"G:\Recorded TV\The Tonight Show Starring Jimmy Fallon_WDSUDT_2014_07_31_22_32_00.wtv" -map_metadata -1 -threads 2 -map 0:2 -map 0:0 -map -0:s -codec:v:0 libx264 -preset superfast -crf 23 -maxrate 1872000 -bufsize 3744000 -r 23.97602 -vsync vfr -profile:v baseline -level 3 -force_key_frames expr:gte(t,n_forced*7) -vf "scale=min(iw\,1280):trunc(ow/dar/2)*2" -copyts -flags -global_header -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1000,volume=2" -hls_time 7 -start_number 91 -hls_list_size 1440 -y "C:\Users\Fouchi\AppData\Roaming\MediaBrowser-Server\transcoding-temp\3744d3f76b931f719bda1fbe9ac34397.m3u8" 
CHROME (successful)
ffmpeg.exe -ss 00:13:23.248 -fflags +genpts -async 1 -vsync -1 -i file:"G:\Recorded TV\The Tonight Show Starring Jimmy Fallon_WDSUDT_2014_07_31_22_32_00.wtv" -map 0:2 -map 0:0 -map -0:s -vcodec libvpx -force_key_frames expr:gte(t,n_forced*5) -vf "scale=min(iw\,1280):trunc(ow/dar/2)*2" -speed 16 -quality good -profile:v 2 -slices 8 -crf 12 -maxrate:v 3872000 -bufsize:v (3872000*2) -b:v 3872000 -r 23.97602 -vsync vfr -map_metadata -1 -threads 2 -acodec libvorbis -ac 2 -ab 128000 -af "aresample=async=1000,volume=2" -y "C:\Users\Fouchi\AppData\Roaming\MediaBrowser-Server\transcoding-temp\f489e3e9e93db247fcfc147f05305bef.webm" 

Among other things, I noticed that Chrome adds a fraction of a second to the -ss flag. (Although, when I test this on command line, and add this fraction to the Roku or iOS params, it still gets errors)

Also, I noticed that Roku thinks the file is 1080, but its actually 720.   It also has this error in the log file "[mpeg2video @ 02805b40] Invalid frame dimensions 0x0.".  Not sure if that's has something to do with it.

 

I've attached the full transcode log files for each case as well.

 

I'm running:

  Windows 7 x64

  MB Server Version 3.0.5326.13255  (just released)

  ServerWMC 1.0.0.36  build: 1154

 

This happens for several different wtv files, not just this one.

 

Thanks for your help.

Marc

CHROME-(Success)-transcode-8efed521-06fe-4a5d-8f9d-2a75b1dff5e1.txt

iOS-transcode-8d3bd535-6583-4665-8ad9-91ba4e5bce01.txt

ROKU-transcode-a9cfe923-0abc-4338-826f-0a07aef72b32.txt

Edited by Mfouchi
  • Like 1
Link to comment
Share on other sites

Mfouchi

Hi @krustyreturns,

Would this be under your jurisdiction since its dealing with LiveTV?  I'm not sure where the ffmpeg command gets issued.  Is ServerWMC responsible for kicking off the transcoding?

Thanks,

Marc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...