[vlc-devel] strange behavior: with sub sources I can show custom marquee while playing YET not in transcode section?!

XYZFounder XYZFounder at aol.com
Sat Oct 12 15:59:32 CEST 2013


Main goal: To dynamically change logo and text (custom count-downer!) my
http video live stream!

I use vlc.py to control the vlc player instance.

WHEN I simply use instance = vlc.Instance("--sub-source logo:marq")
with # media = instance.media_new('tester.mp4') then I get my logo
AND the countdown timer as marq into VLC player. (ALL perfect)
 

NOW; when I want to have an http output created I need somehow sub
source to be in my transcode part, but it only shows the raw mp4 video
(no logo nor text) instead then :(

IF I use sfilter statsments it seems vlc is freezing it in and then
uses it, hence I'm get the starting time but no update (hence I also
cannot alter the logo.



ANY IDEAS:

THX
NetBean5000


instance = vlc.Instance("--sub-source logo:marq") # works!
#instance = vlc.Instance("--sub-filter logo:marq")

# instance = vlc.Instance("--sout=#stream_out_duplicate{dst=display,dst=std{access=file,mux=ts,dst=/tmp/captured.mpg}}")
# instance = vlc.Instance("--sub-source logo:marq :sout=std{access=http, mux=asf, dst=127.0.0.1:1234} :sout-keep")

media = instance.media_new('tester.mp4')
# media = instance.media_new('tester.mp4', ":sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100, sfilter=logo:marq}:std{access=http, mux=asf, dst=127.0.0.1:1234}", ":sout-keep")

# media = instance.media_new('tester.mp4', ":sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100,ssource=marq:logo}:std{access=http, mux=asf, dst=127.0.0.1:1234}", ":sout-keep")

player = vlc.libvlc_media_player_new(instance)

# http://stackoverflow.com/questions/16515099/saving-a-stream-while-playing-it-using-libvlc


player.video_set_marquee_int(vlc.VideoMarqueeOption.Enable, 1)
player.video_set_marquee_int(vlc.VideoMarqueeOption.Size, 24)  # pixels
player.video_set_marquee_int(vlc.VideoMarqueeOption.Position, vlc.Position.BottomRight)

player.video_set_marquee_int(vlc.VideoMarqueeOption.Timeout, 0)  # millisec, 0==forever
player.video_set_marquee_int(vlc.VideoMarqueeOption.Refresh, 1000)  # millisec (or sec?)
##t = '$L / $D or $P at $T'
t = 'Go Royalz: %Y-%m-%d  %H:%M:%S '
player.video_set_marquee_string(vlc.VideoMarqueeOption.Text, vlc.str_to_bytes(t))

hours=0
minutes=10
seconds=0

player.video_set_logo_int(vlc.VideoLogoOption.enable, 1)

player.video_set_logo_string(vlc.VideoLogoOption.file, "/tmp/TVLogo2.png")
player.video_set_logo_string(vlc.VideoLogoOption.logo_x, "10")
player.video_set_logo_string(vlc.VideoLogoOption.logo_y, "10")
player.video_set_logo_int(vlc.VideoLogoOption.opacity, 150)
player.video_set_logo_int(vlc.VideoLogoOption.position, 3)
player.video_set_logo_int(vlc.VideoLogoOption.repeat, 1000)



player.set_media(media)
player.play()

total = timedelta(hours=hours, minutes=minutes, seconds=seconds)
for passed_seconds in range(int(total.total_seconds())):
    ERG = total - timedelta(seconds=passed_seconds)
    print ("jetzt %s") %ERG
    print ("passed %i") %passed_seconds
    line=ERG
	
    #player.video_set_marquee_int(vlc.VideoMarqueeOption.Enable, 0)
    player.video_set_marquee_string(vlc.VideoMarqueeOption.Text, vlc.str_to_bytes("erstes Viertel: " + str(line)+ " "))	
    #player.video_set_marquee_string(vlc.VideoMarqueeOption.Text, vlc.str_to_bytes(t))
    
    if passed_seconds > 10:
	player.video_set_logo_string(vlc.VideoLogoOption.file, "/tmp/R-Logo.png")
    else:
	player.video_set_logo_string(vlc.VideoLogoOption.file, "/tmp/TVLogo2.png")	

    time.sleep(1)



More information about the vlc-devel mailing list