This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: GStreamer encode issue

Part Number: AM5728

Hello,

Card: Ti AM5728 evm

Kernel: 4.4.41

I use the pipeline below to encode with "splitmuxsink", Streaming via network and display but it doesn't work:

gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)800, height=(int)480, framerate=(fraction)30/1' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! tee name=t1 \
t1. ! queue ! ducatih264enc ! queue ! tee name=t2 \
t2. ! queue ! h264parse ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234 \
t2. ! queue ! h264parse ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 \
t1. ! queue ! kmssink

 

Setting pipeline to PAUSED ...
[ 5519.272743] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 5520.598471] vip 48990000.vip: dma_alloc_coherent of size 770048 failed

** (gst-launch-1.0:1514): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

** (gst-launch-1.0:1514): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

** (gst-launch-1.0:1514): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

** (gst-launch-1.0:1514): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

** (gst-launch-1.0:1514): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

Best regards :)

Faiez,

  • The software team have been notified. They will respond here.
  • Hello,

    This pipeline has these branches right:

    Capture->display;

    Capture->encode->streaming;

    Capture->encode->save in file?

    I would recommend you first to try separately these branches are they working.

    Let me know the result.

    BR

    Margarita

  • Hello,

    1. I tried separately these branches and  they are working.
    2. capture --> display
    Capture->encode->streaming via network;
    Capture->encode->save in file with splitmuxsink

    BR :)
    Faiez,

  • Hello,

    Could you try to move the second tee element (t2) after the parser?

    BR
    Margarita
  • Hello,

    I also tried to move the second tee element (t2) after the parser and it is working.

    BR :)
    Faiez,
  • Hello,

    Please verify the answer if the issue is solved.

    BR
    Margarita
  • no, it doesn't work ! with the three branches !!
  • Could you post the new pipeline after we move the second tee element (t2) (after the parser) ?

  • Hello,

    Could you post the 3 pipelines that are working on your side?

    BR
    Margarita
  • Hello,

    No it doesn't work with the 3 branches..separatly it works well but it must work together with tee element (3 branches), that is the problem.

    BR

    Faiez 

  • Hello,

    I meant to link these pipelines:
    capture --> display
    Capture->encode->streaming via network;
    Capture->encode->save in file with splitmuxsink
    which are working on your side before to merge them with tee element into one pipeline.

    BR
    Margarita
  • Hello,

    Faiez said:
    Could you post the new pipeline after we move the second tee element (t2) (after the parser) ?

    It should be something like:

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)800, height=(int)480, framerate=(fraction)30/1' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! tee name=t1  ! queue ! ducatih264enc ! queue ! h264parse ! tee name=t2 ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234 t2. ! queue !  splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink

    BR
    Margarita

  • Hello,

    No it doesn't work with the 3 branches..separatly it works well but it must work together with tee element (3 branches), that is the problem.

    BR

    Faiez

  • Hello,

    I understand your problem.
    I am asking to post the pipelines that are working.
    These 3 pipelines:
    capture --> display
    Capture->encode->streaming via network
    Capture->encode->save in file with splitmuxsink

    Also check previous post.

    BR
    Margarita
  • Hello,

    Please also try this pipeline and let me know the result:
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)800, height=(int)480, framerate=(fraction)30/1' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! tee name=t1 ! queue ! ducatih264enc ! queue ! h264parse ! tee name=t2 ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234 t2. ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink

    BR
    Margarita
  • Hi,

    This pipeline does not work.

    BR
    Faiez
  • Hi,

    Separatly ? i told you that it works.., here is the three pipelines:

    * capture --> display:

    gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)800, height=(int)480' ! timeoverlay ! vpe num-input-buffers=8 ! queue ! kmssink

    * Capture->encode->streaming via network:

    gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! timeoverlay ! vpe num-input-buffers=8 ! \
    queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234

    * Capture->encode->save in file with splitmuxsink:

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6630 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! timeoverlay ! vpe num-input-buffers=8 ! ducatih264enc bitrate=4000 ! queue ! tee name=t t. ! queue ! h264parse ! splitmuxsink location=test3%02d.mp4 max-size-time=60000000000 t. ! queue ! h264parse ! splitmuxsink location=test31%02d.mp4 max-size-time=30000000000

    BR

    Faiez

  • Hi,

    There is one other things, after we execute the pipeline with the three branches (with tee element) we have this:

    ** (gst-launch-1.0:1376): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (gst-launch-1.0:1376): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed

    ** (gst-launch-1.0:1376): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed
    [ 2082.725398] v4l2src0:src invoked oom-killer: gfp_mask=0x24201ca, order=0, oom_score_adj=0
    [ 2082.733873] v4l2src0:src cpuset=/ mems_allowed=0
    [ 2082.738897] CPU: 0 PID: 1388 Comm: v4l2src0:src Tainted: G O 4.4.41-gf9f6f0db2d #1
    [ 2082.747630] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 2082.753746] Backtrace:
    [ 2082.756220] [<c00130f8>] (dump_backtrace) from [<c00132f4>] (show_stack+0x18/0x1c)
    [ 2082.763818] r7:ec4bf078 r6:600f0113 r5:00000000 r4:c0964e4c
    [ 2082.769537] [<c00132dc>] (show_stack) from [<c02b46ac>] (dump_stack+0x8c/0xa0)
    [ 2082.776794] [<c02b4620>] (dump_stack) from [<c011d34c>] (dump_header+0x5c/0x1ac)
    [ 2082.784218] r7:ec4bf078 r6:00000000 r5:cd039d04 r4:ec4bec00
    [ 2082.789934] [<c011d2f0>] (dump_header) from [<c00d2d34>] (oom_kill_process+0x2fc/0x448)
    [ 2082.797968] r10:c093d928 r9:00062590 r8:0000036d r7:ec4bf078 r6:000701c5 r5:cd039d04
    [ 2082.805864] r4:ec4bec00
    [ 2082.808415] [<c00d2a38>] (oom_kill_process) from [<c00d31e0>] (out_of_memory+0x2f0/0x32c)
    [ 2082.816624] r10:c093d928 r9:00062590 r8:c093d928 r7:c093dba8 r6:000701c5 r5:cd039d04
    [ 2082.824522] r4:ec4bec00
    [ 2082.827073] [<c00d2ef0>] (out_of_memory) from [<c00d80b4>] (__alloc_pages_nodemask+0x924/0x964)
    [ 2082.835805] r10:c0990a00 r9:024201ca r8:00000000 r7:c093a660 r6:cd038000 r5:00000000
    [ 2082.843700] r4:00000000
    [ 2082.846252] [<c00d7790>] (__alloc_pages_nodemask) from [<c00d1a2c>] (filemap_fault+0x1bc/0x4f0)
    [ 2082.854983] r10:024000c0 r9:c0990a00 r8:ed99dcc0 r7:d473ab30 r6:0000001c r5:00000000
    [ 2082.862877] r4:d473ac14
    [ 2082.865430] [<c00d1870>] (filemap_fault) from [<c0194c28>] (ext4_filemap_fault+0x34/0x48)
    [ 2082.873638] r10:b6e00000 r9:00000000 r8:ffefe000 r7:b6e00000 r6:cd039ddc r5:d10a4c00
    [ 2082.881533] r4:d473ab18
    [ 2082.884085] [<c0194bf4>] (ext4_filemap_fault) from [<c00f512c>] (__do_fault+0x44/0xa0)
    [ 2082.892031] r7:b6e00000 r6:ec725a40 r5:c09c1880 r4:00000000
    [ 2082.897745] [<c00f50e8>] (__do_fault) from [<c00f9274>] (handle_mm_fault+0x910/0x12f4)
    [ 2082.905692] r5:c09c1880 r4:d10a4c00
    [ 2082.909297] [<c00f8964>] (handle_mm_fault) from [<c001ca64>] (do_page_fault+0x288/0x358)
    [ 2082.917418] r10:00000054 r9:ec725a7c r8:b6e00e44 r7:80000207 r6:ec725a40 r5:ec4bd400
    [ 2082.925312] r4:cd039fb0
    [ 2082.927862] [<c001c7dc>] (do_page_fault) from [<c0009350>] (do_PrefetchAbort+0x38/0x9c)
    [ 2082.935895] r10:b6a4c3c8 r9:001c2198 r8:cd039fb0 r7:b6e00e44 r6:c001c7dc r5:00000207
    [ 2082.943791] r4:c093ef04
    [ 2082.946339] [<c0009318>] (do_PrefetchAbort) from [<c00142a0>] (ret_from_exception+0x0/0x20)
    [ 2082.954723] Exception stack(0xcd039fb0 to 0xcd039ff8)
    [ 2082.959793] 9fa0: b6eee37c 0000091f 62616d64 b6eece7c
    [ 2082.968004] 9fc0: 0000091f 001a58c8 00147c10 b06c4a54 001bfd90 001c2198 b6a4c3c8 3b9ac9ff
    [ 2082.976215] 9fe0: b6a4c4e8 b06c4a10 b6e4932c b6e00e44 20030010 ffffffff
    [ 2082.982853] r8:30c5387d r7:30c5387d r6:ffffffff r5:20030010 r4:b6e00e44
    [ 2082.989922] Mem-Info:
    [ 2082.992275] active_anon:418941 inactive_anon:7290 isolated_anon:0
    [ 2082.992275] active_file:31 inactive_file:41 isolated_file:0
    [ 2082.992275] unevictable:0 dirty:0 writeback:0 unstable:0
    [ 2082.992275] slab_reclaimable:1242 slab_unreclaimable:2963
    [ 2082.992275] mapped:2091 shmem:7727 pagetables:1113 bounce:0
    [ 2082.992275] free:2126 free_pcp:133 free_cma:481
    [ 2083.025751] DMA free:7908kB min:2520kB low:3148kB high:3780kB active_anon:438592kB inactive_anon:14544kB active_file:140kB inactive_file:140kB unevictable:0kB isolated(anon):0kB isolated(file):0kB preso
    [ 2083.070969] lowmem_reserve[]: 0 0 1221 1221
    [ 2083.075643] HighMem free:472kB min:512kB low:2492kB high:4472kB active_anon:1237172kB inactive_anon:14616kB active_file:16kB inactive_file:104kB unevictable:0kB isolated(anon):0kB isolated(file):0kB pro
    [ 2083.120031] lowmem_reserve[]: 0 0 0 0
    [ 2083.124148] DMA: 78*4kB (UE) 116*8kB (UEC) 67*16kB (UEC) 51*32kB (UEC) 28*64kB (UEC) 10*128kB (EC) 3*256kB (UC) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 7784kB
    [ 2083.139309] HighMem: 0*4kB 1*8kB (U) 1*16kB (U) 2*32kB (UM) 2*64kB (UM) 0*128kB 1*256kB (M) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 472kB
    [ 2083.152027] 8014 total pagecache pages
    [ 2083.155839] 0 pages in swap cache
    [ 2083.159229] Swap cache stats: add 0, delete 0, find 0/0
    [ 2083.164481] Free swap = 0kB
    [ 2083.167407] Total swap = 0kB
    [ 2083.170298] 466176 pages RAM
    [ 2083.173195] 318720 pages HighMem/MovableOnly
    [ 2083.177497] 6971 pages reserved
    [ 2083.180648] 47104 pages cma reserved
    [ 2083.184236] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
    [ 2083.192818] [ 116] 0 116 2657 556 8 2 0 0 systemd-journal
    [ 2083.202376] [ 190] 0 190 2723 264 7 2 0 -1000 systemd-udevd
    [ 2083.211739] [ 359] 998 359 3035 55 7 2 0 0 systemd-timesyn
    [ 2083.221296] [ 666] 0 666 2186 770 8 2 0 0 ofonod
    [ 2083.230098] [ 688] 999 688 1081 87 6 2 0 -900 dbus-daemon
    [ 2083.239369] [ 762] 997 762 2718 60 4 2 0 0 systemd-network
    [ 2083.248963] [ 775] 0 775 495 18 4 2 0 0 syslogd
    [ 2083.257878] [ 780] 0 780 491 52 4 2 0 0 klogd
    [ 2083.266597] [ 783] 994 783 1166 67 6 2 0 0 avahi-daemon
    [ 2083.275930] [ 789] 0 789 479 46 4 2 0 0 starter
    [ 2083.284825] [ 795] 994 795 1166 54 5 2 0 0 avahi-daemon
    [ 2083.294160] [ 803] 0 803 50253 39 101 2 0 0 ti-mctd
    [ 2083.303059] [ 804] 0 804 651 53 5 2 0 0 systemd-logind
    [ 2083.312596] [ 833] 0 833 35760 207 24 2 0 0 charon
    [ 2083.321414] [ 1067] 0 1067 1217 80 6 2 0 0 login
    [ 2083.330118] [ 1069] 0 1069 447 27 5 2 0 0 agetty
    [ 2083.338902] [ 1077] 996 1077 747 47 4 2 0 0 systemd-resolve
    [ 2083.348493] [ 1084] 0 1084 1292 230 6 2 0 0 lighttpd
    [ 2083.357463] [ 1113] 0 1113 2441 24 3 2 0 0 lad_dra7xx
    [ 2083.366609] [ 1116] 0 1116 491 14 3 2 0 0 telnetd
    [ 2083.375513] [ 1125] 65534 1125 614 147 4 2 0 0 thttpd
    [ 2083.384292] [ 1132] 0 1132 574 22 4 2 0 0 rngd
    [ 2083.392928] [ 1207] 0 1207 1336 390 5 2 0 0 systemd
    [ 2083.401816] [ 1211] 0 1211 1827 369 6 2 0 0 (sd-pam)
    [ 2083.410796] [ 1218] 0 1218 703 85 5 2 0 0 sh
    [ 2083.419254] [ 1356] 0 1356 566 29 5 2 0 0 runWeston
    [ 2083.428307] [ 1359] 0 1359 5537 1961 13 2 0 0 weston
    [ 2083.437106] [ 1360] 0 1360 1787 375 6 2 0 0 weston-keyboard
    [ 2083.446688] [ 1361] 0 1361 2046 442 6 2 0 0 weston-desktop-
    [ 2083.456280] [ 1376] 0 1376 442879 414399 833 3 0 0 gst-launch-1.0
    [ 2083.465788] Out of memory: Kill process 1376 (gst-launch-1.0) score 877 or sacrifice child
    [ 2083.474189] Killed process 1376 (gst-launch-1.0) total-vm:1771516kB, anon-rss:1657556kB, file-rss:40kB
    [ 2083.751729] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Killed
    [ 2083.789287] virtio_rpmsg_bus virtio1: msg received with no recipient

    BR
    Faiez

  • Hello,

    Thanks I needed  these pipelines to check are they merged correctly since I can not set your use case.

    Please try these pipelines:


    1.
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t1 ! queue ! ducatih264enc ! h264parse ! tee name=t2 ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=1234 t2. ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=false

    2.

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t1 ! queue ! ducatih264enc ! tee name=t2 ! h264parse ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=1234 t2. ! h264parse ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=false

    The difference in both pipelines are the place of the tee t2 element.
    I also set the caps filter after the vpe element. The mpegtsmux is added also. The splitmuxsink element wraps a muxer and a sink element so I have suspicious that there should be a muxer in the streaming branch also. rtph264pay is also removed.

    Let me know the result.

    BR
    Margarita

  • Hi,

    1. The result after execution of the first pipeline:

    Stting pipeline to PAUSED ...
    [ 4496.748720] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    iPpeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    g(st-launch-1.0:1409): GStreamer-CRITICAL **: gst_capsget_structure: assertion 'index < GST_CAPS_LEN (caps)' failed

    (gst-launch-1.0:1409): GStreamer-CRITICAL **: gst_structure_get_string: assertion 'structure != NULL' failed

    (gst-launch-1.0:1409): GStreamer-CRITICAL **: gst_caps_get_structure: assertion 'index < GST_CAPS_LEN (caps)' failed

    (gst-launch-1.0:1409): GStreamer-CRITICAL **: gst_structure_get_string: assertion 'structure != NULL' failed
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    EOS on shutdown enabled -- Forcing EOS on the pipeline[ 4627.189921] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1

    Waiting for EOS...
    ERROR: from element /GstPipeline:pipeline0/MpegTsMux:mpegtsmux0: Could not create handler for stream
    Additional debug info:
    ../../../git/gst/mpegtsmux/mpegtsmux.c(796): mpegtsmux_create_streams (): /GstPipeline:pipeline0/MpegTsMux:mpegtsmux0
    root@am57xx-evm:~# /etc/init.d/weston start
    root@am57xx-evm:~# /etc/init.d/weston stop
    Stopping Weston
    4 t2. ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=falseatih264enc ! h264parse ! tee name=t2 ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=12
    Setting pipeline to PAUSED ...
    [ 4674.237249] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    (gst-launch-1.0:1434): GStreamer-CRITICAL **: gst_caps_get_structure: assertion 'index < GST_CAPS_LEN (caps)' failed

    (gst-launch-1.0:1434): GStreamer-CRITICAL **: gst_structure_get_string: assertion 'structure != NULL' failed

    (gst-launch-1.0:1434): GStreamer-CRITICAL **: gst_caps_get_structure: assertion 'index < GST_CAPS_LEN (caps)' failed

    (gst-launch-1.0:1434): GStreamer-CRITICAL **: gst_structure_get_string: assertion 'structure != NULL' failed
    ERROR: from element /GstPipeline:pipeline0/MpegTsMux:mpegtsmux0: Could not create handler for stream
    Additional debug info:
    ../../../git/gst/mpegtsmux/mpegtsmux.c(796): mpegtsmux_create_streams (): /GstPipeline:pipeline0/MpegTsMux:mpegtsmux0
    EOS on shutdown enabled -- waiting for EOS after Error
    Waiting for EOS...
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Interrupt while waiting for EOS - stopping pipeline...[ 4881.497008] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1

    Execution ended after 0:03:27.211628734
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...

    2. The result after execution of the second pipeline:

    Setting pipeline to PAUSED ...
    [ 4983.997806] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
    Additional debug info:
    gstducatividenc.c(752): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0
    EOS on shutdown enabled -- waiting for EOS after Error
    Waiting for EOS...
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Interrupt while waiting for EOS - stopping pipeline...
    Execution ended after 0:00:10.807257430
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...

  • Hello,

    Try:

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t1 ! queue ! ducatih264enc ! h264parse ! tee name=t2 ! queue ! udpsink host=192.168.100.21 port=1234 t2. ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=false

    Let me know.

    BR
    Margarita
  • Hi,

    Here is the result of this pipeline:

    Setting pipeline to PAUSED ...
    [ 7247.231693] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
    Additional debug info:
    gstducatividenc.c(752): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0
    EOS on shutdown enabled -- waiting for EOS after Error
    Waiting for EOS...
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Interrupt while waiting for EOS - stopping pipeline...
    Execution ended after 0:00:06.112397463
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...

    BR
    Faiez

  • Hello,


    1.gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t1 ! queue ! ducatih264enc ! h264parse ! tee name=t2 ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=1234 t2. ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=false

    2.
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=6660 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720,framerate=(fraction)30/1' ! videoconvert ! timeoverlay ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t1 ! queue ! ducatih264enc ! tee name=t2 ! h264parse ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=1234 t2. ! h264parse ! queue ! splitmuxsink location=test%02d.mp4 max-size-time=60000000000 t1. ! queue ! kmssink scale=false

    The changes in the pipelines are the framerate is set.
    Let me know result from both pipelines.

    I am wondering is pipeline like this working on your side:
    3.gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw,format=(string)YUY2,width=800,height=600,framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720' ! tee name=t ! queue ! ducatimpeg4enc ! mpeg4videoparse ! tee name=q ! queue ! qtmux ! filesink location=/home/root/video.mp4 q. ! queue ! mpegtsmux ! udpsink host=192.168.100.21 port=1234 sync=false t. ! queue ! kmssink scale=false -v -e

    BR
    Margarita

  • Hi,

    The pipeline in "3" is working when we replace "mpegtsmux" with "rtph264pay"(for streaming via network), but it does not work with the splitmuxsink.

    In fact, i tested the pipeline below and it works (without "splitmuxsink" but with a simple "filesink"):

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1020 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! timeoverlay ! vpe num-input-buffers=8 ! tee name=t1 \
    t1. ! ducatih264enc bitrate=4000 ! queue ! tee name=t2 \
    t2. ! queue ! h264parse ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234 \
    t2. ! queue ! h264parse ! qtmux ! filesink location=test4.mp4 \
    t1. ! queue ! kmssink

    But i want to do streaming via network+display+save with splitmuxsink (not with a simple "filesink").



    BR
    Faiez

  • Hello,

    Could you try to set this properties of splitmuxsink max-size-time=10000000000 max-size-bytes=1000000
    Let me know the result.

    BR
    Margarita
  • Hi,

    It does not work even we change with this "max-size-time=10000000000 max-size-bytes=1000000".

    In fact, i tested the pipeline below and it works (without "splitmuxsink" but with a simple "filesink"):

    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1020 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! timeoverlay ! vpe num-input-buffers=8 ! tee name=t1 \
    t1. ! ducatih264enc bitrate=4000 ! queue ! tee name=t2 \
    t2. ! queue ! h264parse ! queue ! rtph264pay ! queue ! udpsink host=192.168.100.21 port=1234 \
    t2. ! queue ! h264parse ! qtmux ! filesink location=test4.mp4 \
    t1. ! queue ! kmssink

    But i want to do streaming via network+display+save with splitmuxsink (not with a simple "filesink"), that is the problem.



    BR
    Faiez

  • Hello,

    Splitmuxsink wraps a muxer and a sink. By default the muxer which is used is mp4mux and the sink is filesink.
    Could you try to set the property muxer as qtmux.
    It should be :
    splitmuxsink muxer=qtmux
    the sink element is the same as in the pipeline which is working with qtmux+filesink.

    BR
    Margarita
  • Hi,

    It doesn't work, we have always the same problem.

    BR
    Faiez
  • Hello,

    Splitmuxsink is new element since gstreamer 1.5 version and it is not a TI element. I am not aware what limitations it has.
    I would recommend you to check similar use case but on PC with gstreamer 1.6.

    You have another option. You could use filesink to save in multiple video files but you must implement this pipeline into gstreamer application and dynamically link and unlink the filesink element. The limitation in this case will be that you will lose frames between the linking and unlinking.

    BR
    Margarita
  • Hello,

    I did some tests with tee element with combination with splitmuxsink on PC with 1.6 version to check what are the limitations of usage of these elements in the same pipeline.
    The pipeline that I was trying has two branches videotest->display and videotest->encode>splitmuxsisnk.

    The pipeline that was working is:
    gst-launch-1.0 -v -e videotestsrc ! video/x-raw,width=640,height=480 ! tee name=t t. ! queue ! xvimagesink sync=false t. ! queue ! timeoverlay ! x264enc key-int-max=4 ! video/x-h264,profile=baseline ! h264parse config-interval=1 ! splitmuxsink location="f-%05d-output3.h264" max-size-time=10000000000 max-size-bytes=1000000

    I observed that if the key-int-max is not set the pipeline hangs. Key-int-max in this case is the distance between two I frames.
    If the profile is not set the result is the same. The parser's config-interval properties also should be set since the muxer is mp4 not mpegtsmux.

    The strange is that if I use videotest->encode->splitmuxsink stand alone I do not observe any problem if the above properties are not set. The result is the same as yours when you used capture->encode->splitmuxsink standalone.

    gst-launch-1.0 -v -e videotestsrc ! video/x-raw,width=640,height=480 ! queue ! timeoverlay ! x264enc ! video/x-h264,profile=high ! h264parse config-interval=1 ! splitmuxsink location="f-%05d-output3.h264" max-size-time=10000000000 max-size-bytes=1000000

    But as I said you could link and unlink the filesink element to archive your use case. I could provide simple example for this.
    Hope this helps.

    BR
    Margarita
  • Hi,

    Thank you for your reply, so if you can provide for me a simple example to link and unlink the filesink element to archive a splited and playable video files.

    BR
    Faiez

  • Hello,


    Check this link:
    gstreamer.freedesktop.org/.../pipeline-manipulation.html

    This is working on my side with gstreamer 0.10. Should work with 1.0 also:



    /* create_filesink_tail function to create a new sink element
    * end link it to the pipeline
    * */
    static void create_filesink_tail()
    {
    GstPad *srcpad;
    GstPad *sinkpad;

    //Create the new multisink element
    multisink = NULL;
    multisink = gst_element_factory_make ("filesink", NULL);

    if(!multisink)
    {
    g_print("failed to create new sink element! \n");
    return;
    }

    //add it to the bin
    gst_bin_add(GST_BIN (pipeline), multisink);

    //switch the filename
    sprintf(name_buf, "image%05d.jpg", counter++);
    g_print ("File Switching %s\n", name_buf);
    g_object_set( G_OBJECT( multisink ), "location", name_buf, NULL );

    //get and link the pads
    gst_element_link(multi_queue, multisink);
    srcpad = gst_element_get_static_pad( multi_queue, "src" );
    sinkpad = gst_element_get_static_pad( multisink, "sink" );

    gst_element_link_pads (multi_queue, "src", multisink, "sink");

    //gst_pad_link(srcpad,sinkpad);



    //TODO: move it to PLAYING STATE here

    gst_element_set_state (multisink, GST_STATE_PLAYING);
    }

    /*
    * destroy_bin_cb function to remove the multisink element from the pipeline
    * */
    static gboolean destroy_bin_cb (gpointer user_data)
    {
    //oldbin is multisink element easy way to destroy it by using pipeline remove
    GstElement *oldbin = (GstElement *) user_data;

    g_print("Destroying old bin.\n");
    if (pipeline)
    {
    //move it to the NULL state and remove it from the pipeline
    gst_element_set_state (oldbin, GST_STATE_NULL);
    gst_bin_remove (GST_BIN(pipeline), oldbin);
    }
    return FALSE;
    }


    /* replace_filesink_blocked_cb Callback function to block the block, unlink pads
    * */

    static void replace_filesink_blocked_cb (GstPad *pad, gboolean blocked, gpointer user_data)
    {
    int ret;

    if (blocked)
    {
    GstElement *oldbin;
    GstPad *sinkpad;


    g_print("Blocked filesink queue.\n");
    g_static_rec_mutex_lock(&mutex);
    g_print("Locked.\n");
    oldbin = multisink;
    sinkpad = gst_element_get_static_pad(multisink, "sink");
    if (!sinkpad)
    {
    g_print("replace_filesink_blocked_cb: oldbin doesn't have sink pad.\n");
    goto fail;
    }

    //Unlink pads
    gst_pad_unlink(multi_queue_srcpad, sinkpad);
    g_print("Unlinked.\n");

    //send EOS to the multisink sinkpad
    gst_pad_send_event(sinkpad, gst_event_new_eos());
    g_print("Sent event.\n");

    g_print("Checked sinks.\n");


    //Adds a function to be called whenever there are no
    //higher priority events pending to the default main loop.


    g_print("Destroying old bin.\n");
    if (pipeline)
    {
    //move it to the NULL state and remove it from the pipeline
    gst_element_set_state (oldbin, GST_STATE_NULL);
    gst_bin_remove (GST_BIN(pipeline), oldbin);
    }




    //call the tail to create the new multisink element
    create_filesink_tail();



    g_print("Created filesink.\n");
    g_static_rec_mutex_unlock(&mutex);
    g_print("Unlocked mutex.\n");

    /* And unblock again. */
    ret = gst_pad_set_blocked_async(multi_queue_srcpad, gboolean (FALSE), replace_filesink_blocked_cb, NULL);
    g_print("gst_pad_set_unblocked_async ret : %d \n", ret );

    g_print("Done replacing filesink.\n");
    }
    else
    {
    g_print("Unblocked filesink queue.\n");
    }
    return;

    fail:
    g_print("FAIL.....................\n");
    }

    /*replace_filesink function to replace the multisink element
    * */
    static void replace_filesink()
    {
    int ret;

    if (multi_queue_srcpad == NULL)
    g_print("replace_filesink while no multi_queue_srcpad yet, waiting for it to appear.\n");
    else
    {
    ret = gst_pad_set_blocked_async(multi_queue_srcpad, TRUE, replace_filesink_blocked_cb, NULL);
    g_print("gst_pad_set_blocked_async ret : %d \n", ret );
    }
    }

    /*
    * rec_loop function for tests to replace with new multisink element
    * on every N seks
    * */
    gpointer rec_loop(gpointer data)
    {
    int rc;





    while(1)
    {
    sleep(1);

    replace_filesink();

    g_print("replacing file sink complte .. \n");
    }
    }



    /*
    * Keyboard event
    * */


    static gboolean
    mycallback (GIOChannel *channel, GIOCondition cond, gpointer user_data)
    {

    GError *error = NULL;
    gchar *str = NULL;
    pthread_t *thread;
    GError *err = NULL;

    if (g_io_channel_read_line (channel, &str, NULL, NULL, NULL) != G_IO_STATUS_NORMAL) {
    return TRUE;
    }
    if (error != NULL) {
    g_print (error->message);
    exit (1);
    }
    switch (g_ascii_tolower (str[0])) {
    case 'p':

    g_thread_create(rec_loop, NULL, FALSE, &err);

    return TRUE;

    default:
    break;

    }
    g_free (str);
    return TRUE;
    }

    .....


    Hope this helps.

    BR
    Margarita