Erro de TCP do Android falhou ao resolver o nome do host da biblioteca estática

1

Estou usando ffmpeg no android e encontrei e erro, que não ocorre quando estou usando a biblioteca na minha máquina virtual linux. Estou usando o FFmpeg Static Builds, de aqui . Eu estou usando o estável 3.1.5 x86_64 construir no emulador e na VM linux ..

O emulador que eu estou usando é o genymotion API 22 nexus 6p, o linux vm é o ubuntu 16.04. O problema também ocorre no meu telefone físico, que é o nexus 5 executando cyanogenmod 6, API 22.

Registro do Android:

ffmpeg version 3.1.5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-2) 20160904
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libebur128 --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil      55. 28.100 / 55. 28.100
libavcodec     57. 48.101 / 57. 48.101
libavformat    57. 41.100 / 57. 41.100
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 47.100 /  6. 47.100
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  1.100 /  2.  1.100
libpostproc    54.  0.100 / 54.  0.100
[tcp @ 0x4029cc0] Failed to resolve hostname r8---sn-ivuoxu-ua8l.googlevideo.com: Name or service not known
https://r8---sn-ivuoxu-ua8l.googlevideo.com/videoplayback?mime=video/mp4&ipbits=0&ratebypass=yes&requiressl=yes&dur=338.175&ms=au&mt=1477750809&fexp=9446761&mv=m&itag=22&mm=31&mn=sn-ivuoxu-ua8l&key=yt6&id=o-ANbaVtkKQuOcWMW9UrYRp47rRSKKc-1d3AGaTRwYVS6z&expire=1477772565&pcm2cms=yes&ip=5.29.246.6&lmt=1470910909244041&ei=tbAUWJvkHsjIiwahzIu4AQ&pl=26&source=youtube&sparams=dur,ei,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&initcwndbps=2532500&upn=jtb8x3K3rqs&signature=D1E8DF4167175F11BE67DE0141B459715047AFDD.69E5499B1345F3A7F2AB4B938F6C05055C3144AB: Input/output error

Aqui está o log da VM do Linux:

ffmpeg version 3.1.5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-2) 20160904
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libebur128 --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://r8---sn-ivuoxu-ua8l.googlevideo.com/videoplayback?mime=video/mp4&ipbits=0&ratebypass=yes&requiressl=yes&dur=338.175&ms=au&mt=1477750809&fexp=9446761&mv=m&itag=22&mm=31&mn=sn-ivuoxu-ua8l&key=yt6&id=o-ANbaVtkKQuOcWMW9UrYRp47rRSKKc-1d3AGaTRwYVS6z&expire=1477772565&pcm2cms=yes&ip=5.29.246.6&lmt=1470910909244041&ei=tbAUWJvkHsjIiwahzIu4AQ&pl=26&source=youtube&sparams=dur,ei,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&initcwndbps=2532500&upn=jtb8x3K3rqs&signature=D1E8DF4167175F11BE67DE0141B459715047AFDD.69E5499B1345F3A7F2AB4B938F6C05055C3144AB':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-08-11 10:21:33
  Duration: 00:05:38.13, start: 0.000000, bitrate: 555 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 426 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2016-08-11 10:21:33
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2016-08-11 10:21:33
      handler_name    : ISO Media file produced by Google Inc.
[ipod @ 0x5264580] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, ipod, to 'output.m4a':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.41.100
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, 125 kb/s (default)
    Metadata:
      creation_time   : 2016-08-11 10:21:33
      handler_name    : ISO Media file produced by Google Inc.
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=    5241kB time=00:05:38.12 bitrate= 127.0kbits/s speed=35.4x    
video:0kB audio:5184kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.112068%

O comando im usando:

./ffmpeg -i 'https://r8---sn-ivuoxu-ua8l.googlevideo.com/videoplayback?mime=video/mp4&ipbits=0&ratebypass=yes&requiressl=yes&dur=338.175&ms=au&mt=1477750809&fexp=9446761&mv=m&itag=22&mm=31&mn=sn-ivuoxu-ua8l&key=yt6&id=o-ANbaVtkKQuOcWMW9UrYRp47rRSKKc-1d3AGaTRwYVS6z&expire=1477772565&pcm2cms=yes&ip=5.29.246.6&lmt=1470910909244041&ei=tbAUWJvkHsjIiwahzIu4AQ&pl=26&source=youtube&sparams=dur,ei,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&initcwndbps=2532500&upn=jtb8x3K3rqs&signature=D1E8DF4167175F11BE67DE0141B459715047AFDD.69E5499B1345F3A7F2AB4B938F6C05055C3144AB' -vn -acodec copy output.m4a

Minha pergunta é que o Android faz algum tipo de restrição em bibliotecas estáticas? O que está causando o problema? Eu não tenho nenhum problema de ping o host logo depois de eu tentar executar o comando, e está funcionando bem!

ping -c 4 r8---sn-ivuoxu-ua8l.googlevideo.com
PING r8.sn-ivuoxu-ua8l.googlevideo.com (213.57.23.19) 56(84) bytes of data.
64 bytes from 213.57.23.19: icmp_seq=1 ttl=57 time=12.6 ms
64 bytes from 213.57.23.19: icmp_seq=2 ttl=57 time=22.3 ms
64 bytes from 213.57.23.19: icmp_seq=3 ttl=57 time=23.1 ms
64 bytes from 213.57.23.19: icmp_seq=4 ttl=57 time=27.1 ms

--- r8.sn-ivuoxu-ua8l.googlevideo.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 12.689/21.322/27.103/5.300 ms

Alguma observação que fiz dos meus testes:

  • O problema não é com a internet, já que posso fazer ping no host logo depois sem problemas.
  • O problema não é com o url, já tentei com este e estou recebendo o mesmo erro https://video-cdn.buzzfeed.com/13800/mp4_640x640/1478210253
  • A biblioteca está funcionando bem na VM linux, mas não no android, isso pode ser um erro com a implementação (a maioria não), o empacotamento (talvez) ou o próprio android.

EDIÇÃO PRINCIPAL:

Acabei de reler o arquivo leia-me para as bibliotecas e notei isso:

 A limitation of statically linking glibc is the loss of DNS resolution. Installing
             nscd through your package manager will fix this or you can use
             "ffmpeg -i http://<ip address here>/" instead of "ffmpeg -i http://example.com/"

Eu dei a função encontrada a partir de c #, que pode fazer o que eu preciso,: pesquisa de DNS msdn

    
por David Barishev 02.11.2016 / 16:09

0 respostas