I have an HD-PVR which outputs a .ts stream (H.264 AVCHD video, and AC-3 audio) in whatever resolution is connected to the input. In this case the feed is a 1080i video stream, and I pipe it to a file for subsequent transcoding.
I like gstreamer, because it is quick. However, it can be a pig at times. I have included the pipeline below.
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 source and sink files.
Playback is choppy, pixellated, and at twice the speed (with pauses).
I have seen in other threads that Tegra has issues with generating interlaced video. However, I am generating progressive formats (720p), so I am at a loss to understand the cause of this issue.
Does anyone have any helpful insights?
gst-launch-1.0 -v -e filesrc location=/home/nvidia/input.ts typefind=true
! decodebin name=demux
demux.
! queue
! audio/x-raw,format=S16LE,rate=48000
! mux.audio_0
demux.
! queue
! nvvidconv
! video/x-raw,format=I420,width=1280,height=720,framerate=30/1
! x264enc bframes=0 b-adapt=false speed-preset=1 tune=0x00000004
! mux.video_0
qtmux name=mux
! filesink sync=true location=/home/nvidia/output.mp4
SOURCE FILE mediainfo :
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@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
SINK FILE mediainfo :
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@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 ##### 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