Revision 795fe885 chunker_streamer/chunker_streamer.c

View differences:

chunker_streamer/chunker_streamer.c
735 735
				pFrame = pFrame1;
736 736

  
737 737
				// usleep(5000);
738
				dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOin pkt: dts %lld pts %lld pts-dts %lld\n", packet.dts, packet.pts, packet.pts-packet.dts );
739
				dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode: pkt_dts %lld pkt_pts %lld frame.pts %lld\n", pFrame->pkt_dts, pFrame->pkt_pts, pFrame->pts);
738
				dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOin pkt: dts %"PRId64" pts %"PRId64" pts-dts %"PRId64"\n", packet.dts, packet.pts, packet.pts-packet.dts );
739
				dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode: pkt_dts %"PRId64" pkt_pts %"PRId64" frame.pts %"PRId64"\n", pFrame->pkt_dts, pFrame->pkt_pts, pFrame->pts);
740 740
				dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode intype %d%s\n", pFrame->pict_type, pFrame->key_frame ? " (key)" : "");
741 741
				if(frameFinished)
742 742
				{ // it must be true all the time else error
......
755 755
#endif
756 756

  
757 757

  
758
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: finished frame %d dts %lld pts %lld\n", frame->number, packet.dts, packet.pts);
758
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: finished frame %d dts %"PRId64" pts %"PRId64"\n", frame->number, packet.dts, packet.pts);
759 759
					if(frame->number==0) {
760 760
						if(packet.dts==AV_NOPTS_VALUE)
761 761
						{
......
811 811
					//apply avfilters
812 812
					filter(pFrame,pFrame2);
813 813
					pFrame = pFrame2;
814
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode: pkt_dts %lld pkt_pts %lld frame.pts %lld\n", pFrame2->pkt_dts, pFrame2->pkt_pts, pFrame2->pts);
814
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode: pkt_dts %"PRId64" pkt_pts %"PRId64" frame.pts %"PRId64"\n", pFrame2->pkt_dts, pFrame2->pkt_pts, pFrame2->pts);
815 815
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOdecode intype %d%s\n", pFrame2->pict_type, pFrame2->key_frame ? " (key)" : "");
816 816
#endif
817 817

  
......
856 856
					}
857 857

  
858 858
					if(!vcopy && pCodecCtxEnc->coded_frame) {
859
						dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOout: pkt_dts %lld pkt_pts %lld frame.pts %lld\n", pCodecCtxEnc->coded_frame->pkt_dts, pCodecCtxEnc->coded_frame->pkt_pts, pCodecCtxEnc->coded_frame->pts);
859
						dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOout: pkt_dts %"PRId64" pkt_pts %"PRId64" frame.pts %"PRId64"\n", pCodecCtxEnc->coded_frame->pkt_dts, pCodecCtxEnc->coded_frame->pkt_pts, pCodecCtxEnc->coded_frame->pts);
860 860
						dcprintf(DEBUG_VIDEO_FRAMES, "VIDEOout: outtype: %d%s\n", pCodecCtxEnc->coded_frame->pict_type, pCodecCtxEnc->coded_frame->key_frame ? " (key)" : "");
861 861
					}
862 862
#ifdef DISPLAY_PSNR
......
878 878
						if(FirstTimeVideo && target_pts>0) {
879 879
							ptsvideo1 = target_pts;
880 880
							FirstTimeVideo = 0;
881
							dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: SET PTS BASE OFFSET %lld\n", ptsvideo1);
881
							dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: SET PTS BASE OFFSET %"PRId64"\n", ptsvideo1);
882 882
						}
883 883
					}
884 884
					else //we want to compensate audio and video offset for this source
......
891 891
							else
892 892
								ptsvideo1 = target_pts;
893 893
							FirstTimeVideo = 0;
894
							dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO LIVE: SET PTS BASE OFFSET %lld\n", ptsvideo1);
894
							dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO LIVE: SET PTS BASE OFFSET %"PRId64"\n", ptsvideo1);
895 895
						}
896 896
					}
897 897
					//compute the new video timestamp in milliseconds
......
900 900
						// store timestamp in useconds for next frame sleep
901 901
						newTime_video = newTime*1000;
902 902
					}
903
					dcprintf(DEBUG_TIMESTAMPING, "VIDEO: NEWTIMESTAMP %ld\n", newTime);
903
					dcprintf(DEBUG_TIMESTAMPING, "VIDEO: NEWTIMESTAMP %lld\n", newTime);
904 904
					if(newTime<0) {
905 905
						dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: SKIPPING FRAME\n");
906 906
						newtime_anomalies_counter++;
......
910 910
						continue; //SKIP THIS FRAME, bad timestamp
911 911
					}
912 912
					
913
					//~ printf("pCodecCtxEnc->error[0]=%lld\n", pFrame->error[0]);
913
					//~ printf("pCodecCtxEnc->error[0]=%"PRId64"\n", pFrame->error[0]);
914 914
	
915 915
					frame->timestamp.tv_sec = (long long)newTime/1000;
916 916
					frame->timestamp.tv_usec = newTime%1000;
......
952 952
#endif
953 953

  
954 954
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: encapsulated frame size:%d type:%d\n", frame->size, frame->type);
955
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: timestamped sec %d usec:%d\n", frame->timestamp.tv_sec, frame->timestamp.tv_usec);
955
					dcprintf(DEBUG_VIDEO_FRAMES, "VIDEO: timestamped sec %ld usec:%ld\n", (long)frame->timestamp.tv_sec, (long)frame->timestamp.tv_usec);
956 956
					//contFrameVideo++; //lets increase the numbering of the frames
957 957

  
958 958
					if(update_chunk(chunk, frame, video_outbuf) == -1) {
......
1081 1081
					if(FirstTimeAudio && packet.dts>0) {
1082 1082
						ptsaudio1 = packet.dts;
1083 1083
						FirstTimeAudio = 0;
1084
						dcprintf(stderr, DEBUG_AUDIO_FRAMES, "AUDIO: SET PTS BASE OFFSET %lld\n", ptsaudio1);
1084
						dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: SET PTS BASE OFFSET %"PRId64"\n", ptsaudio1);
1085 1085
					}
1086 1086
				}
1087 1087
				else //we want to compensate audio and video offset for this source
......
1094 1094
						else
1095 1095
							ptsaudio1 = packet.dts;
1096 1096
						FirstTimeAudio = 0;
1097
						dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO LIVE: SET PTS BASE OFFSET %f\n", ptsaudio1);
1097
						dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO LIVE: SET PTS BASE OFFSET %"PRId64"\n", ptsaudio1);
1098 1098
					}
1099 1099
				}
1100 1100
				//compute the new audio timestamps in milliseconds
......
1103 1103
					// store timestamp in useconds for next frame sleep
1104 1104
					newTime_audio = newTime*1000;
1105 1105
				}
1106
				dcprintf(DEBUG_TIMESTAMPING, "AUDIO: NEWTIMESTAMP %d\n", newTime);
1106
				dcprintf(DEBUG_TIMESTAMPING, "AUDIO: NEWTIMESTAMP %lld\n", newTime);
1107 1107
				if(newTime<0) {
1108 1108
					dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: SKIPPING FRAME\n");
1109 1109
					newtime_anomalies_counter++;
......
1116 1116
				frame->timestamp.tv_usec = (newTime + delay_audio)%1000;
1117 1117
				frame->size = audio_frame_size;
1118 1118
				frame->type = 5; // 5 is audio type
1119
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: pts %lld duration %d timebase %d %lld dts %d\n", packet.pts, (int)packet.duration, pFormatCtx->streams[audioStream]->time_base.num, pFormatCtx->streams[audioStream]->time_base.den, packet.dts);
1120
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: timestamp sec:%d usec:%d\n", frame->timestamp.tv_sec, frame->timestamp.tv_usec);
1121
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: deltaaudio %lld\n", delta_audio);	
1119
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: pts %"PRId64" duration %d timebase %d %d dts %"PRId64"\n", packet.pts, packet.duration, pFormatCtx->streams[audioStream]->time_base.num, pFormatCtx->streams[audioStream]->time_base.den, packet.dts);
1120
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: timestamp sec:%ld usec:%ld\n", (long)frame->timestamp.tv_sec, (long)frame->timestamp.tv_usec);
1121
				dcprintf(DEBUG_AUDIO_FRAMES, "AUDIO: deltaaudio %"PRId64"\n", delta_audio);	
1122 1122
				contFrameAudio++;
1123 1123

  
1124 1124
				if(update_chunk(chunkaudio, frame, audio_outbuf) == -1) {

Also available in: Unified diff