FAQ  •  Register  •  Login

MKV to TS - a bug in FFmpeg?

<<

ozpete999

Serviio newbie

Posts: 12

Joined: Sat Feb 19, 2011 5:02 pm

Post Tue Mar 29, 2011 5:36 pm

MKV to TS - a bug in FFmpeg?

Following on from my experiences trying to transcode for a Toshiba TV (see the topic viewtopic.php?f=7&t=2039) I have found a recurring problem with MKV to TS.

It appears there might be some bug still in FFmpeg (link at end of this post)

I am having problems trying to successfully transcode MKVs to TS. Sometimes it works and sometimes not.
Two examples.

The following “Australian_F1.mkv” file transcodes fine. The FFmpeg –i printouts are as follows:

Input file:
  Code:
C:\Program Files\Serviio\lib>ffmpeg -i Y:\Australian_F1.mkv
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[matroska,webm @ 0164ce60] Estimating duration from bitrate, this may be inaccur
ate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1)
-> 500.00 (500/1)
Input #0, matroska,webm, from 'Y:\Australian_F1.mkv':
  Duration: 00:55:03.00, start: 0.000000, bitrate: 192 kb/s
    Stream #0.0: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 25 fps, 500
tbr, 1k tbn, 50 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
At least one output file must be specified


C:\Program Files\Serviio\lib>ffmpeg.exe -i "y:\Australian_F1.mkv" -y -threads 1
-vcodec mpeg2video -sameq -r 25 -g 15 -s 720x576 -copyts -acodec ac3 -ab 128k -a
c 2 -map 0:0 -map 0:1 -sn -f vob "y:\Australian_F1.ts"

Result of the TS ouput file is:
  Code:
C:\Program Files\Serviio\lib>ffmpeg -i Y:\Australian_F1.ts
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[mpeg @ 0164ce60] max_analyze_duration reached
Input #0, mpeg, from 'Y:\Australian_F1.ts':
  Duration: 00:00:21.92, start: 1.000000, bitrate: 4441 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 64:45 DAR 16:9]
, 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 128 kb/s
At least one output file must be specified


But if I transcode this "Big_Engineering.mkv" file

  Code:
C:\Program Files\Serviio\lib>ffmpeg -i Y:\Big_Engineering.mkv
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[matroska,webm @ 0164ce60] Estimating duration from bitrate, this may be inaccur
ate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1)
-> 500.00 (500/1)
Input #0, matroska,webm, from 'Y:\Big_Engineering.mkv':
  Duration: 00:48:52.20, start: 0.000000, bitrate: 384 kb/s
    Stream #0.0: Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 25 fps, 500 t
br, 1k tbn, 50 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s
At least one output file must be specified


using this command line

C:\Program Files\Serviio\lib>ffmpeg.exe -i "y:\Big_Engineering.mkv" -y -threads
1 -vcodec mpeg2video -sameq -r 25 -g 15 -s 720x576 -copyts -acodec ac3 -ab 128k
-ac 2 -map 0:0 -map 0:1 -sn -f vob "y:\Big_Engineering.ts"

the resulting TS is
  Code:
C:\Program Files\Serviio\lib>ffmpeg -i Y:\Big_Engineering.ts
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[mpeg @ 0164ce60] max_analyze_duration reached
Input #0, mpeg, from 'Y:\Big_Engineering.ts':
  Duration: 00:00:22.04, start: 1.000000, bitrate: 3988 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 1:1 DAR 5:4], 1
04857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 128 kb/s
At least one output file must be specified


The audio plays, but not the video.

Even if I change the aspect by setting the NTSC setting of 720x480

C:\Program Files\Serviio\lib>ffmpeg.exe -i "y:\Big_Engineering.mkv" -y -threads
1 -vcodec mpeg2video -sameq -r 25 -g 15 -s 720x480 -copyts -acodec ac3 -ab 128k
-ac 2 -map 0:0 -map 0:1 -sn -f vob "y:\Big_Engineering.ts"

The result is an unplayable file, as follows
  Code:
C:\Program Files\Serviio\lib>ffmpeg -i Y:\Big_Engineering.ts
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[mpeg @ 0164ce60] max_analyze_duration reached
Input #0, mpeg, from 'Y:\Big_Engineering.ts':
  Duration: 00:00:21.16, start: 1.000000, bitrate: 3609 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 1:1 DAR 3:2], 1
04857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 128 kb/s
At least one output file must be specified


So that still doesn’t work – I get no picture at all (sound is OK, though).

Putting in an aspect of –aspect 16:9 or even aspect –hd720 also doesn’t give me the correct PAR and DAR settings.

I read on the internet that prior to 0.6.1 of FFmpeg, there were problems transcoding MKV to TS successfully all the time due to a bug. Then, for 0.6.1 there was a workaround.

http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=1&t=1461&st=0&sk=t&sd=a&sid=3c1c12d4f210e691c9ebb6f60c8620a8

That thread offered a workaround – but that doesn’t work either.

It may well be that this bug is still present in FFmpeg - or I am doing something incorrect.

Any help much appreciated.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Mar 29, 2011 7:31 pm

Re: MKV to TS - a bug in FFmpeg?

If you running using Serviio's FFmpeg it might be older than 0.6.1. Otherwise you should ask the FFmpeg guys, it's not really Serviio's issue.
<<

ozpete999

Serviio newbie

Posts: 12

Joined: Sat Feb 19, 2011 5:02 pm

Post Wed Mar 30, 2011 2:25 am

Re: MKV to TS - a bug in FFmpeg?

Yes. I can understand indeed that FFmpeg problems can't be resolved by you.

Without knowing all the difficulties of using a newer or latest version of FFmpeg, is it likely that Serviio's new version would update to be using the latest FFmpeg with the latest features?

Thanks
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Mar 30, 2011 8:41 am

Re: MKV to TS - a bug in FFmpeg?

Yes, always trying to bring the latest FFmpeg with a big Serviio release (next will be 0.6)

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 34 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.