[FFmpeg-user] Transcoding live UDP stream from h264 to mpeg2 with mpeg2_qsv

Эдуард Вальчуковский e.valchukovski at gmail.com
Tue May 24 15:24:44 CEST 2016


Hello

I'm trying to transcoding live UDP stream from h264 codec to mpeg2 with
ffmpeg built with --enable-libmfx

We need this because our CATV IP-to-RF-PAL gateway modulator only works
with mpeg2

console command i use:

ffmpeg -re -i udp://234.5.100.9:1234 -vcodec mpeg2_qsv -b:v 2M -minrate:v
2M -maxrate:v 2M -bufsize:v 1.4M -b:a 192k -flush_packets 0 -f mpegts
-metadata service_provider="Home.net" -metadata service_name="OTR" udp://
234.5.100.225:1234?pkt_size=1316

console output:

[root at iptv share]# ffmpeg -re -i udp://234.5.100.9:1234 -vcodec mpeg2_qsv
-b:v 2M -minrate:v 2M -maxrate:v 2M -bufsize:v 1.4M -b:a 192k
-flush_packets 0 -f mpegts -metadata service_provider="Home.net" -metadata
service_name="OTR" udp://234.5.100.225:1234?pkt_size=1316
ffmpeg version N-80072-g8441759 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --enable-libmfx --enable-nonfree
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 43.100 / 57. 43.100
  libavformat    57. 37.100 / 57. 37.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
[h264 @ 0x245b6c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x245b6c0] decode_slice_header error
[h264 @ 0x245b6c0] no frame!
[h264 @ 0x245b6c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x245b6c0] decode_slice_header error
[h264 @ 0x245b6c0] no frame!
[h264 @ 0x245b6c0] non-existing PPS 0 referenced
....
....
[h264 @ 0x2df16c0] decode_slice_header error
[h264 @ 0x2df16c0] no frame!
[h264 @ 0x2df16c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2df16c0] decode_slice_header error
[h264 @ 0x2df16c0] no frame!
[h264 @ 0x2df16c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2df16c0] decode_slice_header error
[h264 @ 0x2df16c0] no frame!
[h264 @ 0x2df16c0] Increasing reorder buffer to 2
Input #0, mpegts, from 'udp://234.5.100.9:1234':
  Duration: N/A, start: 89774.735978, bitrate: N/A
  Program 4480
    Metadata:
      service_name    : ?09 ▒▒▒
      service_provider: ?▒▒▒▒
    Stream #0:0[0x1181]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt470bg), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn
    Stream #0:1[0x1184](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, s16p, 192 kb/s
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
[mpegts @ 0x2e99460] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mpegts, to 'udp://234.5.100.225:1234?pkt_size=1316':
  Metadata:
    service_provider: Home.net
    service_name    : OTR
    encoder         : Lavf57.37.100
    Stream #0:0: Video: mpeg2video, nv12, 720x576 [SAR 16:11 DAR 20:11],
q=2-31, 2000 kb/s, 25 fps, 90k tbn
    Metadata:
      encoder         : Lavc57.43.100 mpeg2_qsv
    Side data:
      cpb: bitrate max/min/avg: 2000000/2000000/2000000 buffer size:
1400000 vbv_delay: -1
    Stream #0:1(rus): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      encoder         : Lavc57.43.100 mp2
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (mpeg2_qsv))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))
Press [q] to stop, [?] for help
[h264 @ 0x3078f40] reference picture missing during reorderbitrate=N/A
speed=   0x
[h264 @ 0x3078f40] Missing reference picture, default is 65513
[h264 @ 0x307ef00] mmco: unref short failure
[h264 @ 0x30d25a0] mmco: unref short failure
[h264 @ 0x3078f40] mmco: unref short failure
[h264 @ 0x30cc660] mmco: unref short failure
frame=11721 fps= 25 q=-0.0 Lsize=  136935kB time=00:07:50.64
bitrate=2383.5kbits/s speed=   1x
video:114481kB audio:11019kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 9.110894%
Exiting normally, received signal 2.
....
....

Output UDP stream is broken and won't play on VLC (sometimes plays,
sometimes not with only sound). Hardware RF-PAL modulator for CATV says is
audio and video is scrambled

VLC player output messages:

core debug: processing request item: udp://234.5.100.225:1234, node:
Плейлист, skip: 0

core debug: resyncing on udp://234.5.100.225:1234

core debug: udp://234.5.100.225:1234 is at 2

core debug: starting playback of the new playlist item

core debug: resyncing on udp://234.5.100.225:1234

core debug: udp://234.5.100.225:1234 is at 2

core debug: creating new input thread

core debug: Creating an input for 'udp://234.5.100.225:1234'

core debug: requesting art for udp://234.5.100.225:1234

core debug: looking for meta fetcher module matching "any": 1 candidates

lua debug: Trying Lua scripts in
C:\Users\Eduard\AppData\Roaming\vlc\lua\meta\fetcher

lua debug: Trying Lua scripts in C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\fetcher

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac

lua debug: skipping script (unmatched scope) C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac

core debug: no meta fetcher modules matched

core debug: searching art for udp://234.5.100.225:1234

core debug: looking for art finder module matching "any": 2 candidates

lua debug: Trying Lua scripts in
C:\Users\Eduard\AppData\Roaming\vlc\lua\meta\art

lua debug: Trying Lua scripts in C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: skipping script (unmatched scope) C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: skipping script (unmatched scope) C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: skipping script (unmatched scope) C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

qt4 debug: IM: Setting an input

lua debug: skipping script (unmatched scope) C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

core debug: no art finder modules matched

core debug: looking for meta fetcher module matching "any": 1 candidates

lua debug: Trying Lua scripts in
C:\Users\Eduard\AppData\Roaming\vlc\lua\meta\fetcher

lua debug: Trying Lua scripts in C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\fetcher

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac

core debug: using meta fetcher module "lua"

core debug: removing module "lua"

core debug: searching art for udp://234.5.100.225:1234

core debug: looking for art finder module matching "any": 2 candidates

lua debug: Trying Lua scripts in
C:\Users\Eduard\AppData\Roaming\vlc\lua\meta\art

lua debug: Trying Lua scripts in C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac

core debug: no art finder modules matched

core debug: art not found for udp://234.5.100.225:1234

core debug: using timeshift granularity of 50 MiB, in path
'C:\Users\Eduard\AppData\Local\Temp'

core debug: `udp://@234.5.100.225:1234' gives access `udp' demux `' path `@
234.5.100.225:1234'

core debug: specified demux `any'

core debug: creating demux: access='udp' demux='any' location='@
234.5.100.225:1234' file='\\@234.5.100.225:1234'

core debug: looking for access_demux module matching "udp": 12 candidates

core debug: no access_demux modules matched

core debug: creating access 'udp' location='@234.5.100.225:1234', path='\\@
234.5.100.225:1234'

core debug: looking for access module matching "udp": 21 candidates

udp debug: opening server=:0 local=234.5.100.225:1234

core debug: net: opening 234.5.100.225 datagram port 1234

core debug: using access module "udp"

core debug: Using block method for AStream*

core debug: starting pre-buffering

core debug: received first data after 79 ms

core debug: prebuffering done 1316 bytes in 0s - 16 KiB/s

core debug: looking for stream_filter module matching "any": 6 candidates

core debug: no stream_filter modules matched

core debug: looking for stream_filter module matching "record": 6 candidates

core debug: using stream_filter module "record"

core debug: creating demux: access='udp' demux='any' location='@
234.5.100.225:1234' file='\\@234.5.100.225:1234'

core debug: looking for demux module matching "any": 66 candidates

ts debug: Force Seek Per Percent: PCR's not found,

ts debug: pid[256] unknown

ts debug: pid[257] unknown

ts debug: PATCallBack called

ts debug: new PAT ts_id=1 version=0 current_next=1

ts debug: * number=1 pid=4096

ts debug: PMTCallBack called

ts debug: new PMT program number=1 version=0 pid_pcr=256

ts debug: * es pid=256 type=2 fcc=mpgv

core debug: selecting program id=1

ts debug: * es pid=257 type=3 dr->i_tag=0xa

ts debug: found language: rus

ts debug: * es pid=257 type=3 fcc=mpga

core debug: using demux module "ts"

core debug: looking for decoder module matching "any": 43 candidates

avcodec debug: CPU flags: 0x010010db

avcodec debug: trying to use direct rendering

avcodec debug: allowing 3 thread(s) for decoding

avcodec debug: avcodec codec (MPEG-1/2 Video) started

core debug: using decoder module "avcodec"

core debug: looking for packetizer module matching "any": 23 candidates

core debug: using packetizer module "packetizer_mpegvideo"

core debug: looking for decoder module matching "any": 43 candidates

core debug: using decoder module "mpeg_audio"

ts debug: DEMUX_SET_GROUP 0 00000000

core debug: looking for meta reader module matching "any": 2 candidates

lua debug: Trying Lua scripts in
C:\Users\Eduard\AppData\Roaming\vlc\lua\meta\reader

lua debug: Trying Lua scripts in C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\reader

lua debug: Trying Lua playlist script C:\Program Files
(x86)\VideoLAN\VLC\lua\meta\reader\filename.luac

core debug: no meta reader modules matched

core debug: `udp://@234.5.100.225:1234' successfully opened

ts warning: first packet for pid=256 cc=0x2

core debug: Buffering 0%

ts debug: PSINewTableCallBack: table 0x42(66) ext=0x1(1)

ts debug: SDTCallBack called

ts debug: new SDT ts_id=1 version=0 current_next=1 network_id=1

ts debug: * service id=1 eit schedule=0 present=0 running=4 free_ca=0

ts debug: - type=1 provider=Home.net name=OTR

core debug: EsOutProgramMeta: number=1

mpeg_audio debug: MPGA channels:2 samplerate:48000 bitrate:192

core debug: Buffering 8%

packetizer_mpegvideo debug: waiting for sequence start

core debug: reusing audio output

directsound debug: Opening DirectSound Audio Output

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 16%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

directsound debug: Windows speaker config: Stereo and stream has 2
channels, using 2 channels

core debug: output 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes

core debug: looking for audio volume module matching "any": 2 candidates

core debug: using audio volume module "float_mixer"

core debug: input 'mpga' 48000 Hz Stereo frame=1152 samples/1161 bytes

core debug: looking for audio filter module matching "scaletempo": 14
candidates

scaletempo debug: format: 48000 rate, 2 nch, 4 bps, fl32

scaletempo debug: params: 30 stride, 0.200 overlap, 14 search

scaletempo debug: 1.000 scale, 1440.000 stride_in, 1440 stride_out, 1152
standing, 288 overlap, 672 search, 2400 queue, fl32 mode

core debug: using audio filter module "scaletempo"

core debug: conversion: 'mpga'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo

core debug: looking for audio converter module matching "any": 12 candidates

core debug: no audio converter modules matched

core debug: looking for audio converter module matching "any": 12 candidates

mpgatofixed32 debug: mpga->f32l, bits per sample: 32

core debug: using audio converter module "mpgatofixed32"

core debug: conversion pipeline complete

core debug: conversion: 'f32l'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo

core debug: conversion pipeline complete

core debug: looking for audio resampler module matching "any": 3 candidates

core debug: using audio resampler module "samplerate"

core debug: End of audio preroll

core debug: Buffering 24%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 32%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 40%

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 48%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 56%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 64%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 72%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 80%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 88%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Buffering 96%

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

core debug: Stream buffering done (1040 ms in 970 ms)

core debug: Decoder wait done in 0 ms

packetizer_mpegvideo debug: waiting for sequence start

core warning: playback way too early (-629103): playing silence

core debug: inserting 30196 zeroes

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start

packetizer_mpegvideo debug: waiting for sequence start




P.S. If i use mpeg2video instead mpeg2_qsv codec  - all works correctly.
But i need hardware accelerated solution


More information about the ffmpeg-user mailing list