Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP parser error #1447

Open
Prathik9 opened this issue Nov 8, 2024 · 12 comments
Open

UDP parser error #1447

Prathik9 opened this issue Nov 8, 2024 · 12 comments

Comments

@Prathik9
Copy link

Prathik9 commented Nov 8, 2024

E1108 08:40:14.781702 8 mp2t_media_parser.cc:122] Parsing failed for pid = 101, type=3
I1108 08:40:14.781818 8 status.cc:76] 8 (PARSER_FAILURE): Cannot parse media file udp://192.168.50.4:3501
E1108 08:40:14.781987 7 packager_main.cc:628] Packaging Error: 8 (PARSER_FAILURE): Cannot parse media file udp://192.168.50.4:3501

in between packaging, the error appeared , but the udp is transcoded with mpe-ts correctly , whats the main problem here

@joeyparrish
Copy link
Member

Without assigning blame, a parser error means that the parser doesn't understand the content as formatted. It's possible for the content to be malformed, and it's possible for the parser to be buggy.

Can you please share your Packager command line and some information on the source of the UDP stream?

@Prathik9
Copy link
Author

'packager', 'input=udp://10.0.90.38:5002,stream=video,init_segment=/var/opt/live/test_1/video_1/video_init.mp4,segment_template=/var/opt/live/test_1/video_1/video_$Number$.m4s,drm_label=VIDEO,hls_name=video_1,iframe_playlist_name=/var/opt/live/test_1/video_1/iframe.m3u8,hls_group_id=video',

'input=udp://10.0.90.38:5002,stream=audio,init_segment=/var/opt/live/test_1/audio_tr1/audio_init.mp4,segment_template=/var/opt/live/test_1/audio_tr1/audio_$Number$.m4s,stream_selector=1,language=tr1,hls_name=tr1,hls_group_id=audio,playlist_name=/var/opt/live/test_1/audio_tr1/audio_tr1.m3u8,drm_label=AUDIO',

'--segment_duration=2',
'--hls_playlist_type=LIVE',
'--allow_approximate_segment_timeline',
'--time_shift_buffer_depth=40',
'--preserved_segments_outside_live_window=5',
'--hls_master_playlist_output=/var/opt/live/test_1/master.m3u8',
'--mpd_output=/var/opt/live/test_1/master.mpd',
'--v=2'

This is the packager cmd I am using.
I am getting UDP from SRT, where I am transcoding it and pushing to the IP's port

@joeyparrish
Copy link
Member

Can you share information about the transcode? Are you using FFmpeg, or something else? What version? What command?

@Prathik9
Copy link
Author

i am using GStreamer for the transcode don't know much about that I will share what I know
GOP=50
codec=h264
MPEG-TS

@joeyparrish
Copy link
Member

Could gstreamer have a bug that creates malformed TS packets? Can you update it to the latest release and try again?

Can you also try taking some of those TS that failed to parse and checking them against another parser, such as https://thumb.co.il/ ?

@lathadp4
Copy link

I am also using Gstreamer and also getting the same error.
How should I get that TS that has malformed? I am converting filesrc(mp4> --> udp) in the gstreamer pipeline, so whether the problem is in input mp4?

@Prathik9
Copy link
Author

Prathik9 commented Nov 19, 2024

E1119 05:46:23.075434 8 h264_parser.cc:1011] Interlaced streams not supported
W1119 05:46:23.075440 8 mp2t_media_parser.cc:393] Ignoring unsupported stream with pid=101
E1119 05:46:23.075564 8 demuxer.cc:112] Invalid argument, stream=1 not available.
I1119 05:46:23.075581 8 status.cc:76] 3 (INVALID_ARGUMENT): Stream not available
E1119 05:46:23.076109 7 packager_main.cc:628] Packaging Error: 3 (INVALID_ARGUMENT): Stream not available

Any one explain this? Is this related to same bug from above

@joeyparrish
Copy link
Member

How should I get that TS that has malformed?

As I said, could you try taking some of those TS that failed to parse and checking them against another parser, such as https://thumb.co.il/ ?

If they are parsed successfully by other software, that could help someone understand the problem and improve the parser in Shaka Packager. If they fail there, too, then please report the bug to gstreamer: https://gstreamer.freedesktop.org/documentation/contribute/index.html?gi-language=c#how-to-file-issues-and-request-for-enhancements

@lathadp4
Copy link

In UDP input, how can I get TS packets for the parser test?
'packager', 'input=udp://10.0.90.38:5002,stream=video,init_segment=/var/opt/live/test_1/video_1/video_init.mp4,segment_template=/var/opt/live/test_1/video_1/video_$Number$.m4s,drm_label=VIDEO,hls_name=video_1,iframe_playlist_name=/var/opt/live/test_1/video_1/iframe.m3u8,hls_group_id=video',
'input=udp://10.0.90.38:5002,stream=audio,init_segment=/var/opt/live/test_1/audio_tr1/audio_init.mp4,segment_template=/var/opt/live/test_1/audio_tr1/audio_$Number$.m4s,stream_selector=1,language=tr1,hls_name=tr1,hls_group_id=audio,playlist_name=/var/opt/live/test_1/audio_tr1/audio_tr1.m3u8,drm_label=AUDIO','--segment_duration=2','--hls_playlist_type=LIVE',
'--allow_approximate_segment_timeline',
'--time_shift_buffer_depth=40',
'--preserved_segments_outside_live_window=5',
'--hls_master_playlist_output=/var/opt/live/test_1/master.m3u8',
'--mpd_output=/var/opt/live/test_1/master.mpd',
'--v=2'

@synologic
Copy link

I'm also seeing the same error on a passed through HEVC stream from ffmpeg to shaka 3.4.0.
This only happens in the very first seconds of the stream, for example, starting ffmpeg + shaka at the same time or if i start shaka first, then ffmpeg, shaka crashes with this error.

If i start shaka after say 10 seconds, all is fine

What i get:
E1124 22:36:44.512183 3446371 mp2t_media_parser.cc:122] Parsing failed for pid = 256, type=3
E1124 22:44:09.020962 3446483 packager_main.cc:629] Packaging Error: 8 (PARSER_FAILURE): Cannot parse media file udp://239.224.20.148:2345?reuse=1&buffer_size=6000000

I dont have an analyzer handy but i'm guessing shaka does not like some of the initial packets sent by ffmpeg. I'll try to capture and run an analysis when i find some time :)

@synologic
Copy link

The TS file is parsed fine by https://media-analyzer.pro/app which also has a bitstream analyzer
image

I can provide both source stream samples as well as ffmpeg passthru stream samples in private

@Prathik9
Copy link
Author

Prathik9 commented Nov 28, 2024

while packaging directly through ffmpeg can't get any parser error

ffmpeg -i udp://224.0.10.15:3030 -map 0:v -c:v copy -f hls -hls_time 4 -hls_segment_filename /opt/var/5002/video_%03d.ts /opt/var/5002/video.m3u8 -map 0:a -c:a copy -f hls -hls_time 4 -hls_segment_filename /opt/var/5002/audio_%03d.ts /opt/var/5002/audio.m3u8 -master_pl_name /opt/var/5002/master.m3u8 -var_stream_map "v:0 a:0"

i tried for m4s and also didnt get an mp2t mpeg2t parser error using ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants