[FFmpeg-user] ffmpeg generated h.264 stream

2016-05-24 Thread Kenneth Fields
hi,

Wondering if anyone has any insight about h.264 byte code stream:

The ffmpeg command line is:

  fmpeg\" -s 320x240 -f avfoundation -r 30.00 -i \"0:none\" -c:v libx264 
-preset ultrafast -tune zerolatency -x264opts 
crf=20:vbv-maxrate=3000:vbv-bufsize=100:intra-refresh=1:slice-max-size=1500:keyint=30:ref=1
 -b:v 1000 -an -f mpegts -threads 8 -profile:v baseline -level 3.0 -pix_fmt 
yuv420p udp://127.0.0.1:5564 "  

  In theory, the elementary stream in h.264 should be like this:  
view here: http://artsmesh.io/notice/15153 
 
So the key is to generate individual NALUs from H.264 stream. So we should get 
the bitstream like this:   
view here: http://artsmesh.io/conversation/15160 

We need get the real NALU type like this: 0x1F & NALU type. So 0x27 is equal 
0x67.

Normally, we should just have these NALU type(after the operation of 0x1F & 
NALU type):

1: slice of a non-IDR picture.  (P frame)

5: slice of an IDR picture. (I frame)

6: Supplemental enhancement information. (SEI)

7: Sequence parameter set. (SPS parameter)

8: Picture parameter set. (PPS parameter)",  

9: Access unit delimiter.

But what I get from udp is like this from the first  UDP packet:

In this udp datagram, something doesn’t make sense, after the 0x0001start 
code header, the NALU type is 0xff, and the second one is 0xf0, both of them 
are undefined in h.264.

view here: http://artsmesh.io/notice/15154 
So I’m having trouble finding out why the h.264 stream is not working.

And is that true that the start code header is always four bytes, "0x 0001"

Sent out to the ffmpeg list for Whisky Zed
 
 

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] stream mapping seems to work, but doesn't

2016-05-24 Thread Cley Faye
2016-05-24 18:17 GMT+02:00 sean darcy :

>
> Instead of trying to fix stream order, is there another easier way?


​It might not be the best option, but it should work: you could remux all
your VOBs into ​correctly-arranged mp4 (or any other container that know
better than VOB), then concatenate them. All this using -map 0:v and -map
0:a to avoid potential ordering issue for intermediate VOBs. This option
needs some space to work, but it should be quite fast and scriptable.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

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

2016-05-24 Thread Эдуард Вальчуковский
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@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
  libavformat57. 37.100 / 57. 37.100
  libavdevice57.  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: 200/200/200 buffer size:
140 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 

Re: [FFmpeg-user] stream mapping seems to work, but doesn't

2016-05-24 Thread sean darcy

On 05/24/2016 11:53 AM, sean darcy wrote:

On 05/23/2016 11:29 AM, Nicolas George wrote:

On Mon, May 23, 2016 at 09:31:25 -0400, sean darcy wrote:

I've got a bunch of VOB's I want to concatenate. For most of the VOB's
stream 0:0 is video and 0:1 audio, but for one VOB te streams are
switched, so concat doesn't work.


You need to use the stream id, see the documentation on stream
specifiers.

Le quintidi 5 prairial, an CCXXIV, Moritz Barsnick a écrit :

MPEG program streams, such as VOBs, don't know the concept of "order".
It didn't become quite clear on what grounds ffmpeg chooses the order -
possibly depending on which packet comes first.


Exactly.

Regards,



Tried using stream id's :

ffmpeg  -i out5A.VOB -map i:0x1e0  -map i:0x80 -c copy out5A-x.VOB
...
[mpeg @ 0x23ec120] DTS discontinuity in stream 0: packet 3 with DTS
50761, packet 4 with DTS 53641
Input #0, mpeg, from 'out5A.VOB':
  Duration: 00:25:50.02, start: 0.50, bitrate: 5516 kb/s
Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 224 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8500 kb/s, 29.97 fps, 29.97
tbr, 90k tbn, 59.94 tbc
[svcd @ 0x23f0a80] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, svcd, to 'out5A-x.VOB':
  Metadata:
encoder : Lavf57.29.101
Stream #0:0: Video: mpeg2video, yuv420p, 720x480 [SAR 8:9 DAR 4:3],
q=2-31, max. 8500 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
Stream #0:1: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[svcd @ 0x23f0a80] Timestamps are unset in a packet for stream 0. This
is deprecated and will stop working in the future. Fix your code to set
the timestamps properly
frame=46435 fps=1900 q=-1.0 Lsize= 1043844kB time=00:25:50.02
bitrate=5516.8kbits/s speed=63.4x
...

But no joy:

ffprobe -i out5A-x.VOB
..
Input #0, mpeg, from 'out5A-x.VOB':
  Duration: 00:25:50.02, start: 0.50, bitrate: 5516 kb/s
Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 224 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8500 kb/s, 29.97 fps, 29.97
tbr, 90k tbn, 59.94 tbc

Thanks for any help.



Or am I going at this all wrong? I have a set of VOB's that have random 
steam orders. I want an mp4.


fmpeg -safe 0 -f concat -i mylist.txt \
 -c:v:0 libx264 -c:a:0 aac  out.mp4

where mylist.txt has the VOB's.

The output of this is correct for the VOB's with a stream order that 
matches the first VOB in the list. But any for VOB with the steam order 
switched there's no video. BTW, the video returns for any VOB whose 
stream order matches the first.


Instead of trying to fix stream order, is there another easier way?

sean


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] stream mapping seems to work, but doesn't

2016-05-24 Thread sean darcy

On 05/23/2016 11:29 AM, Nicolas George wrote:

On Mon, May 23, 2016 at 09:31:25 -0400, sean darcy wrote:

I've got a bunch of VOB's I want to concatenate. For most of the VOB's
stream 0:0 is video and 0:1 audio, but for one VOB te streams are
switched, so concat doesn't work.


You need to use the stream id, see the documentation on stream specifiers.

Le quintidi 5 prairial, an CCXXIV, Moritz Barsnick a écrit :

MPEG program streams, such as VOBs, don't know the concept of "order".
It didn't become quite clear on what grounds ffmpeg chooses the order -
possibly depending on which packet comes first.


Exactly.

Regards,



Tried using stream id's :

ffmpeg  -i out5A.VOB -map i:0x1e0  -map i:0x80 -c copy out5A-x.VOB
...
[mpeg @ 0x23ec120] DTS discontinuity in stream 0: packet 3 with DTS 
50761, packet 4 with DTS 53641

Input #0, mpeg, from 'out5A.VOB':
  Duration: 00:25:50.02, start: 0.50, bitrate: 5516 kb/s
Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 224 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, 
smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8500 kb/s, 29.97 fps, 29.97 
tbr, 90k tbn, 59.94 tbc

[svcd @ 0x23f0a80] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, svcd, to 'out5A-x.VOB':
  Metadata:
encoder : Lavf57.29.101
Stream #0:0: Video: mpeg2video, yuv420p, 720x480 [SAR 8:9 DAR 4:3], 
q=2-31, max. 8500 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc

Stream #0:1: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[svcd @ 0x23f0a80] Timestamps are unset in a packet for stream 0. This 
is deprecated and will stop working in the future. Fix your code to set 
the timestamps properly
frame=46435 fps=1900 q=-1.0 Lsize= 1043844kB time=00:25:50.02 
bitrate=5516.8kbits/s speed=63.4x

...

But no joy:

ffprobe -i out5A-x.VOB
..
Input #0, mpeg, from 'out5A-x.VOB':
  Duration: 00:25:50.02, start: 0.50, bitrate: 5516 kb/s
Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 224 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, 
smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 8500 kb/s, 29.97 fps, 29.97 
tbr, 90k tbn, 59.94 tbc


Thanks for any help.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] conversion mp4 -> ts gives error: non-existing SPS 0 referenced in buffering period

2016-05-24 Thread Bernd Pfrommer
I am trying to concatenate several mp4 files together, but conversion
from mp4 to ts is producing a file with errors, and subsequent
concatenation attempts produce an erroneous output file as well.

Here is what I'm using for conversion:

ffmpeg -v warning -y -i seq2.mp4 -c copy -bsf:v h264_mp4toannexb -f
mpegts seq2.ts

(no error message, seems to work fine)

But the resulting .ts file gives error when I try to play it, or even
just ffprobe it, like so:

ffprobe -v warning -select_streams v -show_streams seq2.ts

[h264 @ 0x3a9e160] non-existing SPS 0 referenced in buffering period
Last message repeated 1 times
[h264 @ 0x3a9f9a0] non-existing SPS 0 referenced in buffering period
[STREAM]
 more output here
[/STREAM]

Could somebody please advise?

Thanks!

Bernd


Some information on the original file (I only care about the video, not audio):


ffprobe -v warning -select_streams v -show_streams seq2.mp4
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 0 for input stream 3
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/6
codec_tag_string=avc1
codec_tag=0x31637661
width=1920
height=1080
coded_width=1920
coded_height=1088
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuvj420p
level=41
color_range=pc
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=3/1001
avg_frame_rate=3/1001
time_base=1/9
start_pts=0
start_time=0.00
duration_ts=24435411
duration=271.504567
bit_rate=44967066
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=8137
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:creation_time=2016-04-08 13:44:12
TAG:language=eng
TAG:handler_name= GoPro AVC
TAG:encoder=GoPro AVC encoder
[/STREAM]


The converted file has this stream information:
-

 ffprobe -v warning -select_streams v -show_streams seq2.ts
[h264 @ 0x34d9160] non-existing SPS 0 referenced in buffering period
Last message repeated 1 times
[h264 @ 0x34da9a0] non-existing SPS 0 referenced in buffering period
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/6
codec_tag_string=[27][0][0][0]
codec_tag=0x001b
width=1920
height=1080
coded_width=1920
coded_height=1088
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuvj420p
level=41
color_range=pc
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
timecode=N/A
refs=1
is_avc=false
nal_length_size=0
id=0x100
r_frame_rate=3/1001
avg_frame_rate=3/1001
time_base=1/9
start_pts=126000
start_time=1.40
duration_ts=24435411
duration=271.504567
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] which ffmpeg version began to support rtmp

2016-05-24 Thread Moritz Barsnick
On Tue, May 24, 2016 at 17:30:18 +0800, qw wrote:
> There are various ffmpeg versions available in ffmpeg official website, such 
> as 3.0, 2.8, 2.7, 2.6, 2.5.
> which ffmpeg version began to support rtmp? Thanks!

If you have the choice, do use the newest one you can. Or even git
master HEAD.

The feature support, specifically with regards to RTMP, is listed in
quite some detail in the changelog:

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=Changelog

Using librtmp, version 0.6 started supporting it. Native support came
around 1.0. But there are always improvements ongoing in ffmpeg, so
newer is usually better!

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] which ffmpeg version began to support rtmp

2016-05-24 Thread qw
Hi,

There are various ffmpeg versions available in ffmpeg official website, such as 
3.0, 2.8, 2.7, 2.6, 2.5.

which ffmpeg version began to support rtmp? Thanks!

B.R.

andrew
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".