Advertisement
Guest User

dup packets with ffmpeg run at boot

a guest
Feb 12th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.89 KB | None | 0 0
  1. **********HOST and OS**********************
  2. [root@localhost ~]# uname -a
  3. Linux localhost 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  4. [root@localhost ~]# cat /etc/redhat-release
  5. CentOS release 6.3 (Final)
  6. [root@localhost ~]#
  7.  
  8.  
  9. **************WORKING ffmpeg cmdline*************
  10. ffmpeg -loglevel debug -f x11grab -s 640x480 -r 24 -i :0.0 -acodec copy -f mpegts -vcodec mpeg2video -b 2500k -re "udp://239.0.10.69:10069?ttl=1&pkt_size=1316"
  11.  
  12.  
  13. **********WORKING output*************************
  14. FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
  15. built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
  16. configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  17. libavutil 50.15. 1 / 50.15. 1
  18. libavcodec 52.72. 2 / 52.72. 2
  19. libavformat 52.64. 2 / 52.64. 2
  20. libavdevice 52. 2. 0 / 52. 2. 0
  21. libavfilter 1.19. 0 / 1.19. 0
  22. libswscale 0.11. 0 / 0.11. 0
  23. libpostproc 51. 2. 0 / 51. 2. 0
  24. [x11grab @ 0xb9c670]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 640 height: 480
  25. [x11grab @ 0xb9c670]shared memory extension found
  26. [x11grab @ 0xb9c670]Estimating duration from bitrate, this may be inaccurate
  27. Input #0, x11grab, from ':0.0':
  28. Duration: N/A, start: 1358240627.092891, bitrate: 117964 kb/s
  29. Stream #0.0: Video: rawvideo, rgb565le, 640x480, 117964 kb/s, 24 tbr, 1000k tbn, 24 tbc
  30. [mpegts @ 0xba96f0]muxrate 1 bps, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
  31. Output #0, mpegts, to 'udp://239.0.10.69:10069?ttl=1&pkt_size=1316':
  32. Metadata:
  33. encoder : Lavf52.64.2
  34. Stream #0.0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 2500 kb/s, 90k tbn, 24 tbc
  35. Stream mapping:
  36. Stream #0.0 -> #0.0
  37. Press [q] to stop encoding
  38. frame= 14 fps= 0 q=2.0 size= 122kB time=0.54 bitrate=1849.2kbits/s
  39. frame= 26 fps= 25 q=2.0 size= 200kB time=1.04 bitrate=1569.5kbits/s
  40. frame= 39 fps= 25 q=2.0 size= 278kB time=1.58 bitrate=1440.0kbits/s
  41. frame= 51 fps= 24 q=2.0 size= 353kB time=2.08 bitrate=1389.0kbits/s
  42. frame= 63 fps= 24 q=2.0 size= 431kB time=2.58 bitrate=1365.2kbits/s
  43. frame= 76 fps= 24 q=2.0 size= 514kB time=3.12 bitrate=1346.6kbits/s
  44. frame= 88 fps= 24 q=2.0 size= 595kB time=3.62 bitrate=1345.1kbits/s
  45. frame= 100 fps= 24 q=2.0 size= 675kB time=4.12 bitrate=1340.7kbits/s
  46. frame= 112 fps= 24 q=2.0 size= 754kB time=4.62 bitrate=1335.9kbits/s
  47. frame= 125 fps= 24 q=2.0 size= 834kB time=5.17 bitrate=1321.6kbits/s
  48. frame= 138 fps= 24 q=2.0 size= 914kB time=5.71 bitrate=1312.1kbits/s
  49. frame= 150 fps= 24 q=2.0 size= 994kB time=6.21 bitrate=1311.1kbits/s
  50. frame= 163 fps= 24 q=2.0 size= 1071kB time=6.75 bitrate=1300.3kbits/s
  51. frame= 176 fps= 24 q=2.0 size= 1152kB time=7.29 bitrate=1294.3kbits/s
  52. frame= 188 fps= 24 q=2.0 size= 1235kB time=7.79 bitrate=1298.1kbits/s
  53. frame= 201 fps= 24 q=2.0 size= 1319kB time=8.33 bitrate=1296.9kbits/s
  54. frame= 213 fps= 24 q=2.0 size= 1400kB time=8.83 bitrate=1297.9kbits/s
  55. frame= 226 fps= 24 q=2.0 size= 1481kB time=9.38 bitrate=1294.2kbits/s
  56.  
  57.  
  58.  
  59.  
  60.  
  61. ******************************************************************************************************
  62. The problem is when I try (i've tried many many ways using nohup, rc.local, backgrounded scripts, Upstart scripts, etc) to run that same cmdline at boot, I get intermittent jitter.
  63.  
  64.  
  65. *******************Output when same cmdline run at boot*******************************
  66. FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
  67. built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
  68. configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  69. libavutil 50.15. 1 / 50.15. 1
  70. libavcodec 52.72. 2 / 52.72. 2
  71. libavformat 52.64. 2 / 52.64. 2
  72. libavdevice 52. 2. 0 / 52. 2. 0
  73. libavfilter 1.19. 0 / 1.19. 0
  74. libswscale 0.11. 0 / 0.11. 0
  75. libpostproc 51. 2. 0 / 51. 2. 0
  76. [x11grab @ 0x13fc670]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 640 height: 480
  77. [x11grab @ 0x13fc670]shared memory extension found
  78. [x11grab @ 0x13fc670]Estimating duration from bitrate, this may be inaccurate
  79. Input #0, x11grab, from ':0.0':
  80. Duration: N/A, start: 1358241793.488503, bitrate: 117964 kb/s
  81. Stream #0.0: Video: rawvideo, rgb565le, 640x480, 117964 kb/s, 24 tbr, 1000k tbn, 24 tbc
  82. [mpegts @ 0x14096f0]muxrate 1 bps, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
  83. Output #0, mpegts, to 'udp://239.0.10.69:10069?ttl=1&pkt_size=1316':
  84. Metadata:
  85. encoder : Lavf52.64.2
  86. Stream #0.0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 2500 kb/s, 90k tbn, 24 tbc
  87. Stream mapping:
  88. Stream #0.0 -> #0.0
  89. Press [q] to stop encoding
  90. frame= 17 fps= 0 q=2.0 size= 67kB time=0.67 bitrate= 818.9kbits/s dup=12 drop=0
  91. frame= 32 fps= 26 q=2.0 size= 105kB time=1.29 bitrate= 668.4kbits/s dup=23 drop=0
  92. frame= 47 fps= 25 q=2.0 size= 144kB time=1.92 bitrate= 613.6kbits/s dup=34 drop=0
  93. frame= 62 fps= 25 q=2.0 size= 245kB time=2.54 bitrate= 790.0kbits/s dup=45 drop=0
  94. frame= 77 fps= 25 q=2.0 size= 296kB time=3.17 bitrate= 765.6kbits/s dup=56 drop=0
  95. frame= 92 fps= 25 q=2.0 size= 346kB time=3.79 bitrate= 746.9kbits/s dup=67 drop=0
  96. frame= 107 fps= 25 q=2.0 size= 398kB time=4.42 bitrate= 737.9kbits/s dup=78 drop=0
  97. frame= 122 fps= 24 q=2.0 size= 496kB time=5.04 bitrate= 805.7kbits/s dup=89 drop=0
  98. frame= 136 fps= 24 q=2.0 size= 563kB time=5.62 bitrate= 820.3kbits/s dup=99 drop=0
  99. frame= 151 fps= 24 q=2.0 size= 629kB time=6.25 bitrate= 824.9kbits/s dup=110 drop=0
  100. frame= 166 fps= 24 q=2.0 size= 699kB time=6.88 bitrate= 833.3kbits/s dup=121 drop=0
  101. frame= 181 fps= 24 q=1.6 size= 805kB time=7.50 bitrate= 879.5kbits/s dup=132 drop=0
  102. frame= 196 fps= 24 q=2.0 size= 879kB time=8.12 bitrate= 886.1kbits/s dup=143 drop=0
  103. frame= 211 fps= 24 q=2.0 size= 944kB time=8.75 bitrate= 884.0kbits/s dup=154 drop=0
  104. frame= 226 fps= 24 q=2.0 size= 1012kB time=9.38 bitrate= 884.6kbits/s dup=165 drop=0
  105.  
  106.  
  107. Obviously the dup packets are the problem, that's even how i now troubleshoot remotely without actually seeing the video on a TV.
  108.  
  109. Every time i restart the ffmpeg command after boot it works fine, no jitter, no dup packets. In fact, my Upstart script that has jitter when run duirng boot, if i simply ssh in and tell it to restart the stream service I configured, things work fine.
  110.  
  111. I've tried all sorts of digging with ps, priorities are always the same, same nice level etc.
  112. I'm hoping someone has seen this and has the answer.
  113.  
  114. Trying the same thing on a debian machine works fine.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement