hard to decode video to decklink output

Federico Allegretti allegfede at gmail.com
Wed Apr 3 17:14:54 UTC 2019


kind replay of Ray Tiley solved the issue.
I workaround also the interlace/progressive input problem looking the
blackmagic forum for a my old post, so now the pipeline is (sd pal
interlaced=decklink mode 3)
"uridecodebin uri=file://Path/of/video/file  name=decode decode. !
deinterlace ! autovideoconvert ! interlace field-pattern=2:2 ! videoconvert
! video/x-raw,format=UYVY ! videoscale ! video/x-raw,width=720,height=576 !
videorate ! video/x-raw,framerate=25/1 ! decklinkvideosink mode=3 decode. !
audioconvert !  audio/x-raw, format=S32LE, channels=2 ! audioresample !
decklinkaudiosink"

and is quite perfect, but i have some problems with (at most) mpeg2 videos.

Some will be played with accelerated video (audio is normal and duration is
calculated well).
If i transcode them to mpeg4 with a simple
ffmpeg -i accelerated_video_clip.mpg  ok_video.mp4
pipeline plays well.

ffmpe probe for the BAD video says:
Duration: 00:00:42.26, start: 0.270000, bitrate: 6041 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bottom
first), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s

and media info says:
General
Complete name                            :
/home/v1p3r/Video/temp/spot_i_miei_diritti_video_accelerato.mpg
Format                                   : MPEG-PS
File size                                : 30.4 MiB
Duration                                 : 42 s 264 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 041 kb/s

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main at Main
Format settings                          : BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : Variable
Duration                                 : 42 s 200 ms
Bit rate mode                            : Variable
Bit rate                                 : 5 697 kb/s
Maximum bit rate                         : 9 500 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan order                               : Bottom Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.549
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 28.7 MiB (94%)

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Duration                                 : 42 s 264 ms
Bit rate mode                            : Constant
Bit rate                                 : 224 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 1.13 MiB (4%)

for a working mpeg 2
ffprobe says:
Duration: 00:00:35.76, start: 0.270000, bitrate: 5937 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bottom
first), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s

media info:
General
Complete name                            :
/home/v1p3r/Video/temp/spot_linea_verde_febbraio_2014_ok.mpg
Format                                   : MPEG-PS
File size                                : 25.3 MiB
Duration                                 : 35 s 784 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 934 kb/s

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main at Main
Format settings                          : BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=3, N=12
Duration                                 : 35 s 720 ms
Bit rate mode                            : Variable
Bit rate                                 : 5 592 kb/s
Maximum bit rate                         : 9 500 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan order                               : Bottom Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.539
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 23.8 MiB (94%)

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Duration                                 : 35 s 784 ms
Bit rate mode                            : Constant
Bit rate                                 : 224 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 978 KiB (4%)

This will appen also with autoaudiosink and autovideosink. Accelerated
video.
Seems the problem disappear if i remove the deinterlace/interlace filters
(but now do not play on declink):
gst-launch-1.0  uridecodebin uri=file:///path/to/acceleratedvideo.mpg
name=decode decode. ! autovideoconvert !  videoconvert !
video/x-raw,format=UYVY ! videoscale ! video/x-raw,width=720,height=576 !
videorate ! autovideosink decode. ! audioconvert ! audioresample!
autoaudiosink


On Tue, 2 Apr 2019 at 19:05, Federico Allegretti <allegfede at gmail.com>
wrote:

> hello, searching the net, seeking a way to playback my digital video files
> out of a black magic video card (i got an intensity pro),  i found this
> pipeline to work for most of my video files:
> gst-launch-1.0 uridecodebin
> uri=file:///mnt/nas/postion/of/th/file.extenision name=decode decode. !
> interlace field-pattern=1 ! videoconvert ! video/x-raw,format=UYVY !
> videoscale ! video/x-raw,width=720,height=576 ! videorate !
> video/x-raw,framerate=25/1 ! decklinkvideosink mode=3 decode. !
> audioconvert ! decklinkaudiosink
>
> PS: mode=3 stands for PAL SD 50i as i whant the card to play content out
> of the composite cideo connector.
>
> This works quite well, but with some file  playback do not occours.
>
> for example, with a file shot by cell phone i got no problem (those are
> stats by ffmpeg):
> h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 13976
> kb/s, SAR 1:1 DAR 16:9, 15.03 fps, 15 tbr, 90k tbn, 180k tbc (default)
> Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s
> (default)
>
> but with another edited with pinnacle studio (stats by ffmpeg):
> Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR
> 1:1 DAR 16:9], 2024 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
> Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
> (default)
>
> i got this error:
>
> ERRORE: dall'elemento
> /GstPipeline:pipeline0/GstURIDecodeBin:decode/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
> Internal data stream error.
> Informazioni di debug aggiuntive:
> qtdemux.c(6073): gst_qtdemux_loop ():
> /GstPipeline:pipeline0/GstURIDecodeBin:decode/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
> streaming stopped, reason not-negotiated (-4)
> ERRORE: la pipeline non vuole fare il preroll.
> Impostazione della pipeline a NULL ...
> Esecuzione di free sulla pipeline...
>
> I suppose that the problem could be the samplerate, so i resampled the
> audio in this way:
> ffmpeg -i grand_prix_casagrande.mp4 -vcodec copy -acodec aac -ar 48000 -ab
> 128000 -ac 2 grand_prix_casagrande_48.mp4
>
> and now the new file could be played back.
>
> My question now is: There is a way to make the resample AT RUNTIME (and
> maybe only if needed)?
>
> Thanks a lot,
>
> Federico
>
> --
> Sourceforge: https://sourceforge.net/u/allegfede/
>
> YouTube Channel: https://www.youtube.com/c/v1p3rslab
>
> VIMEO HD videos: http://www.vimeo.com/user1912745/videos
>


-- 
Sourceforge: https://sourceforge.net/u/allegfede/

YouTube Channel: https://www.youtube.com/c/v1p3rslab

VIMEO HD videos: http://www.vimeo.com/user1912745/videos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190403/178b638a/attachment-0001.html>


More information about the gstreamer-devel mailing list