Incorrect/Missing timestamps from tsdemux when transcoding 1080i .ts files
Nicolas Dufresne
nicolas at ndufresne.ca
Mon Mar 26 17:44:50 UTC 2018
Le lundi 26 mars 2018 à 10:22 -0700, hilndr44 a écrit :
> I have an HD-PVR which outputs a .ts stream (comprised of H.264 AVCHD video,
> and AC-3 audio) in whatever resolution is connected to it's input. In this
> case the feed is a 1080i video stream, and I pipe it to a file for
> subsequent transcoding using gstreamer.
>
> The problem is that, in the resultant mp4 file, the video is only half the
> duration (even though the audio is the full 1 minute long). I have included
> the mediainfo results for both the input and output files.
> Playback is choppy, pixellated, and at twice the speed (with pauses in
> video, but no pauses in audio).
>
> The Nvidia devtalk forum has suggested that tsdemux might not give the
> correct timestamps :
> https://devtalk.nvidia.com/default/topic/1031092/jetson-tx2/using-gstreamer-to-transcode-downscale-1080i-videos-on-jetson-tx2/1
>
>
> Are there any alternatives to tsdemux that might handle timestamps better?
No, the GStreamer project only provides one demuxer for MPEG Transport
Stream. This element should produce correct timestamps. Though, we
continuously improve this element and provide correction by making new
upstream release of GStreamer. You should, or NVidia should keep track
of these updates as it's likely your issue have been resolved. As a
reference, the current stable GStreamer is 1.14.0. If you can
reproduces these issues with latest GStreamer, then it would be worth
filing a bug on bugs.gnome.org so it can be addressed (or you could
address it too) and tracked properly.
>
>
>
> gst-launch-1.0 -v -e filesrc location=input.ts \
> ! tsparse \
> ! tsdemux name=demux \
> demux. \
> ! queue \
> ! h264parse \
> ! avdec_h264 \
> ! nvvidconv \
> ! omxh264enc \
> ! mux.video_0 \
> demux. \
> ! queue \
> ! aacparse \
> ! audio/mpeg \
> ! faad \
> ! audio/x-raw, format=S16LE, layout=interleaved, rate=48000, channels=2 \
> ! qtmux name=mux \
> ! filesink sync=false location=output.mp4
>
>
>
>
> INPUT FILE mediainfo : input.ts
> ------------------------------------------------------------
> General
> ID : 1 (0x1)
> Complete name : input.ts
> Format : MPEG-TS
> File size : 53.5 MiB
> Duration : 1mn 1s
> Overall bit rate mode : Variable
> Overall bit rate : 7 202 Kbps
>
> Video
> ID : 256 (0x100)
> Menu ID : 1 (0x1)
> Format : AVC
> Format/Info : Advanced Video Codec
> Format profile : Main at L4
> Format settings, CABAC : Yes
> Format settings, ReFrames : 4 frames
> Format settings, GOP : M=4, N=32
> Codec ID : 27
> Duration : 1mn 2s #####
> Bit rate mode : Variable
> Maximum bit rate : 20.0 Mbps
> Width : 1 920 pixels
> Height : 1 080 pixels
> Display aspect ratio : 16:9
> Frame rate : 30.000 fps #####
> Color space : YUV
> Chroma subsampling : 4:2:0
> Bit depth : 8 bits
> Scan type : Interlaced #####
> Scan type, store method : Separated fields
> Scan order : Top Field First
> Color range : Limited
> Color primaries : BT.709
> Transfer characteristics : BT.709
> Matrix coefficients : BT.709
>
> Audio
> ID : 257 (0x101)
> Menu ID : 1 (0x1)
> Format : AAC
> Format/Info : Advanced Audio Codec
> Format version : Version 2
> Format profile : LC
> Muxing mode : ADTS
> Codec ID : 15
> Duration : 1mn 1s
> Bit rate mode : Variable
> Channel(s) : 2 channels
> Channel positions : Front: L R
> Sampling rate : 48.0 KHz
> Frame rate : 46.875 fps (1024 spf)
> Compression mode : Lossy
> Delay relative to video : -100ms
>
> Menu
> ID : 4096 (0x1000)
> Menu ID : 1 (0x1)
> Duration : 1mn 1s
> List : 256 (0x100) (AVC) / 257 (0x101) (AAC)
> Service name : Service01
> Service provider : FFmpeg
> Service type : digital television
>
>
>
>
>
> OUTPUT FILE mediainfo : output.mp4
> -------------------------------------------------------------------------------
> General
> Complete name : output.mp4
> Format : MPEG-4
> Format profile : QuickTime
> Codec ID : qt 2005.03 (qt )
> File size : 41.0 MiB
> Duration : 1mn 2s
> Overall bit rate : 5 539 Kbps
> Encoded date : UTC 2018-03-15 20:35:15
> Tagged date : UTC 2018-03-15 20:35:15
>
> Video
> ID : 2
> Format : AVC
> Format/Info : Advanced Video Codec
> Format profile : Baseline at L3.1
> Format settings, CABAC : No
> Format settings, ReFrames : 1 frame
> Codec ID : avc1
> Codec ID/Info : Advanced Video Coding
> Duration : 30s 100ms ##### HALF THE SOURCE
> DURATION
> Bit rate : 2 048 Kbps
> Maximum bit rate : 2 097 Kbps
> Width : 1 280 pixels
> Height : 720 pixels
> Display aspect ratio : 16:9
> Frame rate : 30.000 fps ##### BUT SAME FRAMERATE
> Color space : YUV
> Chroma subsampling : 4:2:0
> Bit depth : 8 bits
> Scan type : Progressive #####
> Bits/(Pixel*Frame) : 0.074
> Stream size : 29.5 MiB (72%)
> Writing library : x264 core 148 r2643 5c65704
> Encoding settings : cabac=0 / ref=1 / deblock=0:0:0 / analyse=0:0 / me=dia /
> subme=0 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1
> / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
> chroma_qp_offset=0 / threads=4 / lookahead_threads=4 / sliced_threads=1 /
> slices=4 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 /
> constrained_intra=0 / bframes=0 / weightp=0 / keyint=300 / keyint_min=30 /
> scenecut=0 / intra_refresh=0 / rc_lookahead=0 / rc=cbr / mbtree=0 /
> bitrate=2048 ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 /
> vbv_maxrate=2048 / vbv_bufsize=1228 / nal_hrd=none / filler=0 /
> ip_ratio=1.40 / aq=0
> Language : English
> Encoded date : UTC 2018-03-15 20:35:15
> Tagged date : UTC 2018-03-15 20:35:15
>
> Audio
> ID : 1
> Format : PCM
> Format settings, Endianness : Little
> Format settings, Sign : Signed
> Codec ID : sowt
> Duration : 1mn 2s
> Bit rate mode : Constant
> Bit rate : 1 536 Kbps
> Channel(s) : 2 channels
> Channel positions : Front: L R
> Sampling rate : 48.0 KHz
> Bit depth : 16 bits
> Stream size : 11.4 MiB (28%)
> Language : English
> Encoded date : UTC 2018-03-15 20:35:15
> Tagged date : UTC 2018-03-15 20:35:15
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180326/ffc1db67/attachment.sig>
More information about the gstreamer-devel
mailing list