public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@linuxtv.org>
To: Josef Wolf <jw@raven.inka.de>
Cc: linux-dvb@linuxtv.org
Subject: Re: [linux-dvb] How to convert MPEG-TS to MPEG-PS on the fly?
Date: Thu, 28 Aug 2008 16:40:50 +0200	[thread overview]
Message-ID: <20080828144050.GA9065@linuxtv.org> (raw)
In-Reply-To: <20080827220019.GM32022@raven.wolf.lan>

On Thu, Aug 28, 2008 at 12:00:20AM +0200, Josef Wolf wrote:
> 
> Inspired by your detailed description, I decided to hack together an
> quick-n-dirty script to analyze dvbsnoop's timing output.  I attach
> the script at the end of this mail.  First, I'd like to present some
> of the results.  Given a file containing TS (z.ts), I ran those commands:
> 
>   $ rm z.mpg
>   $ ffmpeg -f dvd -acodec copy -vcodec copy -i  z.ts  z.mpg
>   $  ./parsesnoop z.mpg   20
>    pkt-nr   id   len        PTS           DTS          ESCR         SCR
>   00000001 0xba 0x000c                                           14:05:04.5660
>   00000005 0xba 0x000c                                           14:05:04.7942
>   00000007 0xe0 0x0800 22:35:16.0619               13:44:30.5997
>   00000008 0xe0 0x0800 26:05:52.7719 19:59:24.0657
...
> All of those times look pretty much wired to me.  There seem to be no
> consistency at all.  Just some random numbers.  But this stream plays
> very good on all the players I tried.
> 
> Then I tried:
> 
>   $ libdvb-0.5.5.1/dvb-mpegtools/ts2ps 120 110 <z.ts >z.ts2ps
>   $ ./parsesnoop z.ts2ps 20
>    pkt-nr   id   len        PTS           DTS          ESCR         SCR
>   00000001 0xba 0x000e                                            4:42:57.2304
>   00000003 0xe0 0x0800 17:58:19.1292 17:58:19.0092
>   00000033 0xe0 0x0800 17:58:19.0492
>   00000042 0xe0 0x0800 17:58:19.0892
>   00000052 0xe0 0x0800 17:58:19.2492 17:58:19.1292
...
> This looks much more consistent.  The only strange thing is that ESCR
> is missing.  But all the players I tried (except mplayer) fail to play
> this stream in one way or another.

The ESCR isn't normally used, I think it means the PES streams don't have
a common time base. The SCR in the second case doesn't match the
DTS/PTS values. A software player would probably ignore it anyway
and sync A/V via PTS only, but a hardware deocder might decide to
play asynchronously. Are you sure dvbsnoop output is correct?

Have you tried iso13818ps from http://www.scara.com/~schirmer/o/mplex13818/ ?
(linked from http://linuxtv.org/projects.php , BTW)

You mentioned you are discarding the adaptation fields. This means
you don't handle timebase discontinuities. Try to feed the original
TS to iso13818ps (not your filtered one), it should handle it correctly.

ISO-13818-4 (MPEG2 conformance testing) explains a bit how the
decoder model works. Look for document "ISO/IEC JTC1/SC29/WG11 N0804".
(I'm assuming you already have "ITU-T Recommendation H.222.0" aka ISO-13818-1)


HTH,
Johannes

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

  reply	other threads:[~2008-08-28 14:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 21:10 [linux-dvb] How to convert MPEG-TS to MPEG-PS on the fly? Josef Wolf
2008-08-20 21:17 ` Steven Toth
2008-08-20 21:48   ` Josef Wolf
2008-08-21 12:10     ` barry bouwsma
2008-08-21 17:45       ` Josef Wolf
2008-08-22  1:07         ` Kevin Sheehan
2008-08-22  5:15           ` barry bouwsma
2008-08-22 15:16             ` Josef Wolf
2008-08-22 14:44           ` Josef Wolf
2008-08-22 15:44             ` Nick Ludlam
2008-08-25 19:02               ` Josef Wolf
2008-08-26  6:49                 ` Nico Sabbi
2008-08-26 12:00                   ` barry bouwsma
2008-08-26 22:45                     ` Josef Wolf
2008-08-27  7:26                       ` barry bouwsma
2008-08-27 22:00                         ` Josef Wolf
2008-08-28 14:40                           ` Johannes Stezenbach [this message]
2008-08-28 19:34                             ` Josef Wolf
2008-08-28 21:09                               ` Johannes Stezenbach
2008-08-28 22:48                                 ` Josef Wolf
2008-08-29  5:49                                   ` Josef Wolf
2008-08-29 15:45                       ` [linux-dvb] PTS/DTS clarification (Was: How to convert MPEG-TS to MPEG-PS on the fly?) Josef Wolf
2008-08-26 22:31                   ` [linux-dvb] How to convert MPEG-TS to MPEG-PS on the fly? Josef Wolf
2008-08-21 19:17 ` Josef Wolf
2008-08-21 21:14   ` Josef Wolf
2008-08-22  8:10     ` [linux-dvb] RE : " Thierry Lelegard
2008-08-25 19:55       ` Josef Wolf
2008-08-26  6:50         ` Nico Sabbi
2008-08-26 21:19           ` Josef Wolf
2008-08-22  7:57   ` Thierry Lelegard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080828144050.GA9065@linuxtv.org \
    --to=js@linuxtv.org \
    --cc=jw@raven.inka.de \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox