[FFmpeg-user] subtitle issue

Ivan Galičič i.galicic at gmail.com
Thu Mar 28 11:16:40 EET 2019


I have problem with copying subtitles from input to output stream

my ffmpeg without the subtitles, works perfectly

./ffmpeg -v 32 -i "udp://232.2.6.3:5002?localaddr=192.168.245.234" -c:a aac
-ac 2 -c:v hevc_nvenc -qmin 1 -qmax 69 -b:v 2500k -minrate:v 2500k
-maxrate:v 2500k -bufsize:v 2500k -g 50 -cbr 1 -sc_threshold 0 -filter:v
yadif -s 1280x720 -preset:v bd -threads 8 -f mpegts "udp://
232.7.1.3:5002?pkt_size=1316&localaddr=192.168.245.234"

In input I have two subtitles stream, I want to copy just first, but in
such case my output video is braking (very distorted). Issue is only for
shows with subtitles, othervise is ok (commercials for example)

./ffmpeg -v 32 -i "udp://232.2.6.3:5002?localaddr=192.168.245.234" -c:a aac
-ac 2 -c:v hevc_nvenc -qmin 1 -qmax 69 -b:v 2500k -minrate:v 2500k
-maxrate:v 2500k -bufsize:v 2500k -g 50 -cbr 1 -sc_threshold 0 -map 0:s:0
-c:s copy -map 0:v:0 -map 0:a:0  -filter:v yadif -s 1280x720 -preset:v bd
-threads 8 -f mpegts "udp://
232.7.1.3:5002?pkt_size=1316&localaddr=192.168.245.234"


ffmpeg output

Input #0, mpegts, from 'udp://232.2.6.3:5002?localaddr=192.168.245.234':
  Duration: N/A, start: 35750.210578, bitrate: N/A
  Program 770
    Metadata:
      service_name    : Nat Geo HD
      service_provider: Telekom Slovenije
    Stream #0:0[0x44e](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, fltp, 192 kb/s
    Stream #0:1[0x456](slv): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:2[0x5dd]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50
tbr, 90k tbn, 50 tbc
    Stream #0:3[0x19e1](mac): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (h264 (native) -> hevc (hevc_nvenc))
  Stream #0:0 -> #0:2 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'udp://
232.7.1.3:5002?pkt_size=1316&localaddr=192.168.245.234':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0(slv): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:1: Video: hevc (hevc_nvenc) (Main), yuv420p, 1280x720 [SAR
1:1 DAR 16:9], q=1-69, 2500 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.35.100 hevc_nvenc
    Side data:
      cpb: bitrate max/min/avg: 2500000/0/2500000 buffer size: 2500000
vbv_delay: -1
    Stream #0:2(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.35.100 aac
frame=  390 fps= 34 q=22.0 Lsize=    5554kB time=00:00:16.28
bitrate=2794.9kbits/s speed=1.43x
video:4804kB audio:253kB subtitle:34kB other streams:0kB global headers:0kB
muxing overhead: 9.089787%
[aac @ 0x55fe29ef2040] Qavg: 162.650


configurations parameters

./configure \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-ldflags="-Lusr/local/lib/pkgconfig" \
  --extra-cflags=-I/usr/local/cuda/include \
  --extra-ldflags=-L/usr/local/cuda/lib64 \
  --arch=x86_64 \
  --extra-cflags="-march=native -mtune=native" \
  --extra-cxxflags="-march=native -mtune=native" \
  --extra-ldflags="-march=native -mtune=native" \
  --extra-objcflags="-march=native -mtune=native" \
  --extra-ldexeflags="-march=native -mtune=native" \
  --extra-ldsoflags="-march=native -mtune=native" \
  --extra-libs="-lpthread -lm" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-cuda-sdk --enable-cuvid --enable-nvenc --enable-libnpp \
  --enable-libx264 \
  --enable-avfilter \
  --enable-libx265 \
  --enable-nonfree \
  --enable-libnpp \
  --enable-opengl \
  --enable-opencl \
  --enable-libfreetype \
  --enable-libzvbi \
  --enable-libfontconfig \
  --enable-libfreetype \
  --enable-libfribidi \
  --enable-libfdk-aac \
  --enable-libmp3lame


Issue is the same for all ffmpeg versions.

Any clue what I'm doing wrong?

Thanks in advanced
Ivan


More information about the ffmpeg-user mailing list