Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th January 2016, 12:34   #1  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Is there a way to see video after applying packet loss

I have encoded a video stream using JM using RTP. Then i have applied rtp_loss on it but after that i am unable to decode video. Like in this example a video with different packet loss percentages are depicted. I want to apply packet loss on H.264 RTP stream than want to decode it. But whenever i want to decode using JM it is unable to handle it. I have heard that Netem could be an option but i am not using Linux. So Is there a way to apply packet loss on video and than see how video quality is changed after it like in the example gif link given above?
mushahidh is offline   Reply With Quote
Old 26th January 2016, 22:47   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
What about the FFmpeg decoder? Or just use VLC, MPlayer, MPC-HC, etc. pp.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 27th January 2016, 13:28   #3  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
How the video 'looks' with bad data depends on how the decoder has been programmed.

A decoder might try to 'conceal' a bad block by repeating the block from the previous (or next) frame. If there are many bad blocks, it might repeat the whole frame. As a last resort it might return black frame(s) and hope the stream returns to normal soon. A different decoder may do more error concealment, or less.

Point is, there is no particular way a video with bad data will look, unless you control the decoding.

BTW the transmission medium (eg videotape, blu-ray, satellite) might scramble the blocks in space and time, so a big data dropout is broken into many small chunks which are more easily concealed. This again changes how the video 'looks'.

EDIT if you don't like the answers you have gotten so far, perhaps you should explain what you are trying to do exactly.
For my part, my answer was intended to give you some search terms to find more detailed information.
I supposed that if you were compiling a reference codec and injecting errors into the data stream, you were hardly a newbie.

Last edited by raffriff42; 27th January 2016 at 22:38.
raffriff42 is offline   Reply With Quote
Old 28th January 2016, 08:48   #4  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by raffriff42 View Post
I supposed that if you were compiling a reference codec and injecting errors into the data stream, you were hardly a newbie.
You are so big optimist...
pandy is offline   Reply With Quote
Old 28th January 2016, 12:50   #5  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by LoRd_MuldeR View Post
What about the FFmpeg decoder? Or just use VLC, MPlayer, MPC-HC, etc. pp.
FFmpeg even not able to decode RTP stream without any error.I am open to use any codec provided it fulfill my requirement i.e apply packet loss and then decode and see how the video look like.
mushahidh is offline   Reply With Quote
Old 28th January 2016, 12:55   #6  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by raffriff42 View Post
Point is, there is no particular way a video with bad data will look, unless you control the decoding.
So without using any error concealment approach no decoder will able to decode video?
mushahidh is offline   Reply With Quote
Old 28th January 2016, 13:46   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Some players just give up when they come across corrupt/bad streams, others can conceal damage and continue when good stream re-established.
DVD players expect good stream always (as from disk) whereas internet or TV transmission streams have to be fault tolerant and player should be able
to re-establish decoding when bad packets have gone by (whether or not they were able to conceal errors).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 28th January 2016, 14:35   #8  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by StainlessS View Post
DVD players expect good stream always (as from disk)
well yeah, except they are expected to play through dust, scratches, fingerprints...

You're probably right about streaming decoders being the most fault tolerant.

Last edited by raffriff42; 28th January 2016 at 14:50.
raffriff42 is offline   Reply With Quote
Old 28th January 2016, 17:13   #9  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by StainlessS View Post
Some players just give up when they come across corrupt/bad streams, others can conceal damage and continue when good stream re-established.
DVD players expect good stream always (as from disk) whereas internet or TV transmission streams have to be fault tolerant and player should be able
to re-establish decoding when bad packets have gone by (whether or not they were able to conceal errors).
Yeah you are right about it.But question is still there. Is there a way to simulate impact of packet loss in video? Like given here
Right now in JM after packet loss When i want to decode video it shows me warning i.e RTP sequence number discontinuity detected and stop decoding the video.
mushahidh is offline   Reply With Quote
Old 28th January 2016, 17:45   #10  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by raffriff42 View Post

EDIT if you don't like the answers you have gotten so far, perhaps you should explain what you are trying to do exactly.
For my part, my answer was intended to give you some search terms to find more detailed information.
I supposed that if you were compiling a reference codec and injecting errors into the data stream, you were hardly a newbie.
What exactly i want is to
1) Encode video using any H.264 encoder
2) Add redundant bits with each frame to achieve better visual quality after packet loss.
3) Apply packet loss.
4) Perform error correction
5) Decode video
Right now i am encoding a video and applying packet loss on it but unable to decode video after packet loss . I haven't added any redundancy with frames but I want to simulate the difference is visual quality after and before adding Redundant bits in video.
I hope you understand my problem and suggest me a way to go.
mushahidh is offline   Reply With Quote
Old 28th January 2016, 19:46   #11  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
To play a video stream which has errors, you will need error correction and/or error concealment, or decoding will simply fail as you have seen. Error correction first, and if the errors are not correctable, error concealment. The simplest possible way to handle uncorrectable data is to keep showing the last good frame, or show blank frames. Not pretty, but better than crashing.

After that it gets very complicated. I am not an expert in this topic! Perhaps look at existing open source decoders to see what they do.
raffriff42 is offline   Reply With Quote
Old 28th January 2016, 19:58   #12  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by raffriff42 View Post
To play a video stream which has errors, you will need error correction and/or error concealment, or decoding will simply fail as you have seen. Error correction first, and if the errors are not correctable, error concealment. The simplest possible way to handle uncorrectable data is to keep showing the last good frame, or show blank frames. Not pretty, but better than crashing.

After that it gets very complicated. I am not an expert in this topic! Perhaps look at existing open source decoders to see what they do.
Even though in JM decoder i have
Code:
 ConcealMode            = 1                # Err Concealment(0:Off,1:Frame Copy,2:Motion Copy)
But still its unable to decode it with 2% packet loss. Any other decoder that can provide this functionality like keep showing last good frame or blank frames etc ?

Last edited by mushahidh; 28th January 2016 at 20:06.
mushahidh is offline   Reply With Quote
Old 29th January 2016, 03:55   #13  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Try not simulating packet loss for the first few frames at least. How evenly spaced is your 2%? Losing a tiny bit from everything will cause nothing to work.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 29th January 2016, 10:56   #14  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,342
FWIW the FFmpeg decoder is considered to have very good error concealment, but depending on what you drop you might still end up with a undecodable stream.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is online now   Reply With Quote
Old 29th January 2016, 17:21   #15  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by Asmodian View Post
Try not simulating packet loss for the first few frames at least. How evenly spaced is your 2%? Losing a tiny bit from everything will cause nothing to work.
There are 30 frames in the stream . And stream is divided into 258 packets. i am using this command after your suggestion
Code:
 rtp_loss video1.264 video2.264 2 70
which means i am leaving first 70 packets. And from remaining bitstream 2% of 258 packets will be lost. So in this case decoder is able to decode it .
But in case of using error correction code like reed solomon code at frame level to recover packet loss should i add redundancy during encoding or after encoding of video?
mushahidh is offline   Reply With Quote
Old 29th January 2016, 17:23   #16  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by nevcairiel View Post
FWIW the FFmpeg decoder is considered to have very good error concealment, but depending on what you drop you might still end up with a undecodable stream.
Yeah that's right it is highly dependent on what i drop. I have tried using H.264 RTP stream using FFmpeg but it's unable to decode it.It only decode Stream without RTP header.
mushahidh is offline   Reply With Quote
Old 29th January 2016, 18:27   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
JFYI, about the best (fault tolerant) decoder that I have found is the PotPlayer media player.
(also seems to be constantly improving fault tolerance)
GOM player seems to edit some bad streams where it finds corruption.
Current ffmpeg seems to have improved fault tolerance over previous versions.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 29th January 2016, 19:22   #18  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by StainlessS View Post
JFYI, about the best (fault tolerant) decoder that I have found is the PotPlayer media player.
(also seems to be constantly improving fault tolerance)
GOM player seems to edit some bad streams where it finds corruption.
Current ffmpeg seems to have improved fault tolerance over previous versions.
I have installed POtPlayer. But unable to find the way to decode H.264 RTP stream. There isn't any docs available. Any guidance would be highly appreciated.
mushahidh is offline   Reply With Quote
Old 30th January 2016, 12:07   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I did a search and could find little about opening rtp, just this:- https://potplayer.daum.net/forum/sea...p?keywords=rtp

Perhaps post in Daum forum, probably best bet, good luck.

EDIT: The poster did not respond to request for links, but due to request for links by user csumi, looks like it may be possible.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 30th January 2016, 18:33   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, I did google search on "rtp sample url", and found the below link

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

In PotPlayer, Menu Open/Open Url, and copied link into the url link item,
clicked OK, and it played the linked movie (big Buck Bunny).

EDIT: The first few links from above google search will probably be of interest.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 30th January 2016 at 18:46.
StainlessS is offline   Reply With Quote
Reply

Tags
h.264, packet loss, video codec

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.