Project

General

Profile

Bug #3213

h264_mp4toannexb but no video from http stream

Added by Njuskalo Njusko about 9 years ago. Updated about 9 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
IPTV
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Found in version:
4.1-771~gbb50f4e
Affected Versions:

Description

Cannot get video from http link from ffmpeg/pipe (works fine elsewhere).

Here's output:

2015-10-27 10:32:16.157 mpegts: pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts pi - tuning on IPTV
2015-10-27 10:32:16.159 subscription: 0012: "scan" subscribing to mux "pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts pi", weight: 6, adapter: "IPTV", network: "bigtv", service: "Raw PID Subscription" 
2015-10-27 10:32:16.164 spawn: Executing "/usr/bin/ffmpeg" 
2015-10-27 10:32:16.204 spawn: ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
2015-10-27 10:32:16.204 spawn:   built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
2015-10-27 10:32:16.204 spawn:   configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --en
2015-10-27 10:32:16.205 spawn:   libavutil      54.  7.100 / 54.  7.100
2015-10-27 10:32:16.205 spawn:   libavcodec     56.  1.100 / 56.  1.100
2015-10-27 10:32:16.205 spawn:   libavformat    56.  4.101 / 56.  4.101
2015-10-27 10:32:16.205 spawn:   libavdevice    56.  0.100 / 56.  0.100
2015-10-27 10:32:16.205 spawn:   libavfilter     5.  1.100 /  5.  1.100
2015-10-27 10:32:16.205 spawn:   libavresample   2.  1.  0 /  2.  1.  0
2015-10-27 10:32:16.205 spawn:   libswscale      3.  0.100 /  3.  0.100
2015-10-27 10:32:16.205 spawn:   libswresample   1.  1.100 /  1.  1.100
2015-10-27 10:32:16.205 spawn:   libpostproc    53.  0.100 / 53.  0.100
2015-10-27 10:32:16.909 spawn: Input #0, flv, from 'http://INPUT':
2015-10-27 10:32:16.910 spawn:   Metadata:
2015-10-27 10:32:16.912 spawn:     author          : Aljazeera
2015-10-27 10:32:16.912 spawn:     comment         : Aljazeera
2015-10-27 10:32:16.912 spawn:     copyright       : Aljazeera
2015-10-27 10:32:16.912 spawn:     title           : Aljazeera
2015-10-27 10:32:16.912 spawn:     encoder         : BIGTV
2015-10-27 10:32:16.912 spawn:   Duration: 00:00:00.00, start: 0.025000, bitrate: N/A
2015-10-27 10:32:16.912 spawn:     Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1200 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
2015-10-27 10:32:16.912 spawn:     Stream #0:1: Audio: aac, 22050 Hz, stereo, fltp, 192 kb/s
2015-10-27 10:32:16.912 spawn: [adts @ 0x16c7a20] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
2015-10-27 10:32:16.912 spawn: Output #0, mpegts, to 'pipe:1':
2015-10-27 10:32:16.912 spawn:   Metadata:
2015-10-27 10:32:16.912 spawn:     author          : Aljazeera
2015-10-27 10:32:16.912 spawn:     comment         : Aljazeera
2015-10-27 10:32:16.912 spawn:     copyright       : Aljazeera
2015-10-27 10:32:16.912 spawn:     title           : Aljazeera
2015-10-27 10:32:16.912 spawn:     service_name    : Aljazeera
2015-10-27 10:32:16.912 spawn:     service_provider: BIGTV
2015-10-27 10:32:16.912 spawn:     encoder         : Lavf56.4.101
2015-10-27 10:32:16.912 spawn:     Stream #0:0: Video: h264, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1200 kb/s, 25 fps, 90k tbn, 25 tbc
2015-10-27 10:32:16.912 spawn:     Stream #0:1: Audio: aac, 22050 Hz, stereo, 192 kb/s
2015-10-27 10:32:16.912 spawn: Stream mapping:
2015-10-27 10:32:16.912 spawn:   Stream #0:0 -> #0:0 (copy)
2015-10-27 10:32:16.912 spawn:   Stream #0:1 -> #0:1 (copy)
2015-10-27 10:32:16.912 spawn: Press [q] to stop, [?] for help
2015-10-27 10:32:16.912 spawn: [mpegts @ 0x16d0da0] H.264 bitstream malformed, no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it ('-bsf:v h264_mp4toannexb' option with ffmpeg)
2015-10-27 10:32:16.912 spawn: av_interleaved_write_frame(): Invalid data found when processing input
2015-10-27 10:32:16.915 spawn: frame=    1 fps=0.0 q=-1.0 Lsize=       2kB time=00:00:00.04 bitrate= 323.8kbits/s    
2015-10-27 10:32:16.915 spawn: video:28kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2015-10-27 10:32:16.916 spawn: Conversion failed!
2015-10-27 10:32:16.919 iptv: stdin pipe unexpectedly closed: No data
2015-10-27 10:32:21.000 mpegts: pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts pi - scan no data, failed
2015-10-27 10:32:21.000 subscription: 0012: "scan" unsubscribing

after adding -bsf:v h264_mp4toannexb to ffmpeg command chain the output is as follows


2015-10-27 10:33:54.984 mpegts: pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -bsf:v h264_mp4toannexb -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune  - tuning on IPTV
2015-10-27 10:33:54.987 subscription: 0013: "scan" subscribing to mux "pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -bsf:v h264_mp4toannexb -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune ", weight: 6, adapter: "IPTV", network: "bigtv", service: "Raw PID Subscription" 
2015-10-27 10:33:54.991 spawn: Executing "/usr/bin/ffmpeg" 
2015-10-27 10:33:55.040 spawn: ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
2015-10-27 10:33:55.041 spawn:   built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
2015-10-27 10:33:55.041 spawn:   configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --en
2015-10-27 10:33:55.041 spawn:   libavutil      54.  7.100 / 54.  7.100
2015-10-27 10:33:55.041 spawn:   libavcodec     56.  1.100 / 56.  1.100
2015-10-27 10:33:55.041 spawn:   libavformat    56.  4.101 / 56.  4.101
2015-10-27 10:33:55.041 spawn:   libavdevice    56.  0.100 / 56.  0.100
2015-10-27 10:33:55.041 spawn:   libavfilter     5.  1.100 /  5.  1.100
2015-10-27 10:33:55.041 spawn:   libavresample   2.  1.  0 /  2.  1.  0
2015-10-27 10:33:55.041 spawn:   libswscale      3.  0.100 /  3.  0.100
2015-10-27 10:33:55.041 spawn:   libswresample   1.  1.100 /  1.  1.100
2015-10-27 10:33:55.041 spawn:   libpostproc    53.  0.100 / 53.  0.100
2015-10-27 10:33:55.906 spawn: Input #0, flv, from 'http://INPUT':
2015-10-27 10:33:55.906 spawn:   Metadata:
2015-10-27 10:33:55.906 spawn:     author          : Aljazeera
2015-10-27 10:33:55.906 spawn:     comment         : Aljazeera
2015-10-27 10:33:55.906 spawn:     copyright       : Aljazeera
2015-10-27 10:33:55.906 spawn:     title           : Aljazeera
2015-10-27 10:33:55.907 spawn:     encoder         : BIGTV
2015-10-27 10:33:55.907 spawn:   Duration: 00:00:00.00, start: 0.030000, bitrate: N/A
2015-10-27 10:33:55.907 spawn:     Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1200 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
2015-10-27 10:33:55.907 spawn:     Stream #0:1: Audio: aac, 22050 Hz, stereo, fltp, 192 kb/s
2015-10-27 10:33:55.908 spawn: [adts @ 0x2643960] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
2015-10-27 10:33:55.908 spawn: Output #0, mpegts, to 'pipe:1':
2015-10-27 10:33:55.908 spawn:   Metadata:
2015-10-27 10:33:55.908 spawn:     author          : Aljazeera
2015-10-27 10:33:55.908 spawn:     comment         : Aljazeera
2015-10-27 10:33:55.908 spawn:     copyright       : Aljazeera
2015-10-27 10:33:55.908 spawn:     title           : Aljazeera
2015-10-27 10:33:55.908 spawn:     service_name    : Aljazeera
2015-10-27 10:33:55.908 spawn:     service_provider: BIGTV
2015-10-27 10:33:55.908 spawn:     encoder         : Lavf56.4.101
2015-10-27 10:33:55.908 spawn:     Stream #0:0: Video: h264, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1200 kb/s, 25 fps, 90k tbn, 25 tbc
2015-10-27 10:33:55.909 spawn:     Stream #0:1: Audio: aac, 22050 Hz, stereo, 192 kb/s
2015-10-27 10:33:55.909 spawn: Stream mapping:
2015-10-27 10:33:55.909 spawn:   Stream #0:0 -> #0:0 (copy)
2015-10-27 10:33:55.909 spawn:   Stream #0:1 -> #0:1 (copy)
2015-10-27 10:33:55.909 spawn: Press [q] to stop, [?] for help
2015-10-27 10:33:56.412 spawn: frame=  107 fps=0.0 q=-1.0 size=     777kB time=00:00:04.27 bitrate=1489.6kbits/s    
2015-10-27 10:33:56.930 spawn: frame=  180 fps=176 q=-1.0 size=    1297kB time=00:00:07.19 bitrate=1475.8kbits/s    
2015-10-27 10:33:57.500 spawn: frame=  207 fps=130 q=-1.0 size=    1539kB time=00:00:08.25 bitrate=1527.7kbits/s    
2015-10-27 10:33:58.029 spawn: frame=  219 fps=103 q=-1.0 size=    1596kB time=00:00:08.73 bitrate=1497.2kbits/s    
2015-10-27 10:33:58.533 spawn: frame=  232 fps= 88 q=-1.0 size=    1658kB time=00:00:09.25 bitrate=1468.6kbits/s    
2015-10-27 10:33:59.001 mpegts: pipe:///usr/bin/ffmpeg -user-agent Kodi/14.1 -i http://INPUT -bsf:v h264_mp4toannexb -codec:v copy -codec:a copy -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune  scan complete
2015-10-27 10:33:59.001 subscription: 0013: "scan" unsubscribing

attached is .ts that produces no video.


Files

test.ts (6.7 MB) test.ts Njuskalo Njusko, 2015-10-27 10:43
a.ts (7.3 MB) a.ts Njuskalo Njusko, 2015-10-27 12:38

History

#1

Updated by Jaroslav Kysela about 9 years ago

Check the ffmpeg output at first (run pipe command from cmd line and redirect it to a file). If it works, attach 30 seconds from the IPTV mux in TVH (play link).

#2

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

Check the ffmpeg output at first (run pipe command from cmd line and redirect it to a file). If it works, attach 30 seconds from the IPTV mux in TVH (play link).

Excuse my ignorance, what would be the correct syntax to do so ?

#3

Updated by Jaroslav Kysela about 9 years ago

Just remove the 'pipe://' prefix from the URL you specified.

To save the mux's input stream use (for example) : wget -O a.ts 'play_url'

#4

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

Just remove the 'pipe://' prefix from the URL you specified.

To save the mux's input stream use (for example) : wget -O a.ts 'play_url'

tvh@tvheadend:~$ ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -bsf:v h264_mp4toannexb -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts pipe:1
ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, flv, from 'http://INPUT':
  Metadata:
    author          : Aljazeera
    comment         : Aljazeera
    copyright       : Aljazeera
    title           : Aljazeera
    encoder         : BIGTV
  Duration: 00:00:00.00, start: 0.001000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1200 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac, 22050 Hz, stereo, fltp, 192 kb/s
[adts @ 0x1339680] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Output #0, mpegts, to 'pipe:1':
  Metadata:
    author          : Aljazeera
    comment         : Aljazeera
    copyright       : Aljazeera
    title           : Aljazeera
    service_name    : Aljazeera
    service_provider: BIGTV
    encoder         : Lavf56.4.101
    Stream #0:0: Video: h264, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1200 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: aac, 22050 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
G@B?$????HBIGTV    Aljazeeragmi??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????GP???????/D???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????GA0P{
                           ~???
???C????p???????3@?3?n???K ?:8?F+3??긓?`
                                        ????OKL>U
                                                 ? ?1s???ޭ??q??؋?e???8^?

.ts attached in first post was already captured as per your suggestion (wget -O a.ts 'play_url')

#5

Updated by Jaroslav Kysela about 9 years ago

You must redirect standard output to a file - like 'ls > a.txt' so 'ffmpeg > a.ts' .

I mean play URL from the MUX grid (configuration table). Not from service or channels.

#6

Updated by Jaroslav Kysela about 9 years ago

Don't forget to test the .ts file produced by ffmpeg using vlc or any other player.

#7

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

You must redirect standard output to a file - like 'ls > a.txt' so 'ffmpeg > a.ts' .

I mean play URL from the MUX grid (configuration table). Not from service or channels.

ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -bsf:v h264_mp4toannexb -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts > a.ts

Gives me this "At least one output file must be specified"

#8

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

You must redirect standard output to a file - like 'ls > a.txt' so 'ffmpeg > a.ts' .

I mean play URL from the MUX grid (configuration table). Not from service or channels.

Here is .ts produced from command line using this

ffmpeg -user-agent Kodi/14.1 -i http://INPUT -codec:v copy -codec:a copy -bsf:v h264_mp4toannexb -metadata service_provider=BIGTV -metadata service_name=Aljazeera -tune zerolatency -f mpegts pipe:1 > a.ts

Tested in VLC, it produces only audio

#9

Updated by Jaroslav Kysela about 9 years ago

  • Status changed from New to Invalid

OK. So you see that your input is broken. Provide valid MPEG-TS stream to TVHeadend. Closing as invalid. Try upgrade ffmpeg and/or ask on forums. This is a bug and feature tracker for TVH.

#10

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

OK. So you see that your input is broken. Provide valid MPEG-TS stream to TVHeadend. Closing as invalid. Try upgrade ffmpeg and/or ask on forums. This is a bug and feature tracker for TVH.

Finally solved by adding -bsf:v h264_mp4toannexb, dump_extra

#11

Updated by Jaroslav Kysela about 9 years ago

Could you post the whole command? I'll add a note to https://tvheadend.org/projects/tvheadend/wiki/Custom_MPEG-TS_Input . Thanks.

#12

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

Could you post the whole command? I'll add a note to https://tvheadend.org/projects/tvheadend/wiki/Custom_MPEG-TS_Input . Thanks.

Of course.

pipe:///usr/bin/ffmpeg -loglevel fatal -user-agent Kodi/14.1 -i http://INPUT -codec copy -bsf:v h264_mp4toannexb,dump_extra -metadata service_provider=PROVIDER -metadata service_name=SERVICE -tune zerolatency -f mpegts pipe:1

The following option

-user-agent Kodi/14.1

was necessary as my provider is picky on devices used to watch and wouldn't work with ffmpeg's default user agent string.

#13

Updated by Jaroslav Kysela about 9 years ago

Great thanks. I think that it also applies for HEVC.

#14

Updated by Njuskalo Njusko about 9 years ago

Jaroslav Kysela wrote:

Great thanks. I think that it also applies for HEVC.

Great. Glad that it helped.

Also available in: Atom PDF